framework-aidf 0.0.0-stage → 0.2.0
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/CHANGELOG.md +174 -0
- package/INSTALLATION.md +140 -0
- package/LICENSE +21 -0
- package/QODER.md +88 -0
- package/README.md +142 -2
- package/UTILISATION.md +188 -0
- package/assets/adapters/qoder/agents/aidf-orchestrator.md +30 -0
- package/assets/adapters/qoder/rules/00-core.md +28 -0
- package/assets/adapters/qoder/rules/10-security.md +33 -0
- package/assets/adapters/qoder/rules/20-context.md +39 -0
- package/assets/core/AGENTS.fragment.md +18 -0
- package/assets/core/AIDF.md +107 -0
- package/assets/docs/APPFLOW.md +66 -0
- package/assets/docs/BACKEND.md +71 -0
- package/assets/docs/CHANGELOG.md +25 -0
- package/assets/docs/CONVENTIONS.md +95 -0
- package/assets/docs/DECISIONS.md +60 -0
- package/assets/docs/PLAN.md +53 -0
- package/assets/docs/PRD.md +88 -0
- package/assets/docs/SECURITY.md +94 -0
- package/assets/docs/TRD.md +78 -0
- package/assets/docs/UI-UX.md +71 -0
- package/assets/docs/constitution.md +86 -0
- package/assets/hooks/audit.mjs +45 -0
- package/assets/hooks/session-context.mjs +53 -0
- package/assets/integrations/spec-kit/mapping.yaml +92 -0
- package/assets/knowledge/best-practices/testing.md +53 -0
- package/assets/knowledge/best-practices/web-dev-baseline.md +39 -0
- package/assets/knowledge/rules/api.md +45 -0
- package/assets/knowledge/rules/sql.md +44 -0
- package/assets/knowledge/rules/typescript.md +50 -0
- package/assets/knowledge/security-references/owasp-baseline.md +58 -0
- package/assets/registry/activation-map.yaml +83 -0
- package/assets/registry/dependencies.yaml +35 -0
- package/assets/registry/skills.yaml +541 -0
- package/assets/registry/sources.yaml +396 -0
- package/assets/schemas/architecture/v1.json +110 -0
- package/assets/schemas/constraints/v1.json +93 -0
- package/assets/schemas/decision/v1.json +106 -0
- package/assets/schemas/discovery/v1.json +91 -0
- package/assets/schemas/requirement/v1.json +136 -0
- package/assets/schemas/security/threat-model/v1.json +127 -0
- package/assets/schemas/test-plan/v1.json +108 -0
- package/assets/skills/aidf-architecture-review/SKILL.md +49 -0
- package/assets/skills/aidf-backend-implementation/SKILL.md +47 -0
- package/assets/skills/aidf-database-design/SKILL.md +48 -0
- package/assets/skills/aidf-devops-engineering/SKILL.md +41 -0
- package/assets/skills/aidf-documentation-maintenance/SKILL.md +41 -0
- package/assets/skills/aidf-frontend-implementation/SKILL.md +44 -0
- package/assets/skills/aidf-phase-transition/SKILL.md +48 -0
- package/assets/skills/aidf-product-analysis/SKILL.md +47 -0
- package/assets/skills/aidf-project-context/SKILL.md +57 -0
- package/assets/skills/aidf-requirements-engineering/SKILL.md +52 -0
- package/assets/skills/aidf-security-review/SKILL.md +57 -0
- package/assets/skills/aidf-testing-validation/SKILL.md +48 -0
- package/assets/skills/aidf-ui-ux-implementation/SKILL.md +43 -0
- package/assets/workflows/gates.yaml +232 -0
- package/assets/workflows/phases.yaml +161 -0
- package/bin/aidf.mjs +12 -0
- package/demo/run-demo.mjs +97 -0
- package/docs/aidf/ADR-001-artefacts-architectur.md +126 -0
- package/docs/aidf/ADR-002-requirements-registry.md +145 -0
- package/docs/aidf/ADR-003-traceability-chain.md +145 -0
- package/docs/aidf/ADR-004-markdown-generation.md +134 -0
- package/docs/aidf/ADR-005-validation-and-tests.md +170 -0
- package/docs/aidf/ADR-006-cli-commands.md +189 -0
- package/docs/aidf/ADR-007-compatibility-and-migration.md +119 -0
- package/docs/aidf/ADR-008-schema-versioning.md +115 -0
- package/docs/aidf/ADR-009-artefacts-scope.md +84 -0
- package/docs/aidf/ARCHITECTURE.md +137 -0
- package/docs/aidf/COMPATIBILITY.md +90 -0
- package/docs/aidf/DECISIONS.md +200 -0
- package/docs/aidf/FRAMEWORK.md +38 -0
- package/docs/aidf/IDE-QODER.md +61 -0
- package/docs/aidf/INSTALL.md +99 -0
- package/docs/aidf/INVENTORY.md +72 -0
- package/docs/aidf/L1-ARCHITECTURE-RAPPORT.md +353 -0
- package/docs/aidf/LIMITATIONS.md +69 -0
- package/docs/aidf/MATRICE-0.1.0-vers-0.2.0.md +155 -0
- package/docs/aidf/SECURITY.md +86 -0
- package/docs/aidf/SKILLS.md +78 -0
- package/docs/aidf/SPECKIT.md +67 -0
- package/docs/aidf/USAGE.md +113 -0
- package/docs/aidf/VALIDATION.md +55 -0
- package/package.json +37 -4
- package/src/cli.mjs +148 -0
- package/src/commands/artefacts.mjs +129 -0
- package/src/commands/config.mjs +130 -0
- package/src/commands/context.mjs +55 -0
- package/src/commands/decision.mjs +142 -0
- package/src/commands/design.mjs +141 -0
- package/src/commands/docs.mjs +133 -0
- package/src/commands/doctor.mjs +210 -0
- package/src/commands/evidence.mjs +178 -0
- package/src/commands/install.mjs +154 -0
- package/src/commands/release.mjs +214 -0
- package/src/commands/requirements.mjs +196 -0
- package/src/commands/resources.mjs +181 -0
- package/src/commands/scan.mjs +139 -0
- package/src/commands/security.mjs +97 -0
- package/src/commands/setup.mjs +68 -0
- package/src/commands/skills.mjs +204 -0
- package/src/commands/speckit.mjs +78 -0
- package/src/commands/tests.mjs +81 -0
- package/src/commands/traceability.mjs +116 -0
- package/src/commands/uninstall.mjs +238 -0
- package/src/commands/validate.mjs +84 -0
- package/src/commands/workflow.mjs +137 -0
- package/src/core/adapters/base.mjs +32 -0
- package/src/core/adapters/generic.mjs +70 -0
- package/src/core/adapters/index.mjs +24 -0
- package/src/core/adapters/opencode.mjs +115 -0
- package/src/core/adapters/qoder.mjs +228 -0
- package/src/core/artefacts/index.mjs +1 -0
- package/src/core/artefacts/validation.mjs +161 -0
- package/src/core/bootstrap.mjs +179 -0
- package/src/core/config.mjs +123 -0
- package/src/core/context.mjs +187 -0
- package/src/core/design-engineering/complexity-classifier.mjs +78 -0
- package/src/core/design-engineering/engine.mjs +197 -0
- package/src/core/design-engineering/fallback/mockups.mjs +221 -0
- package/src/core/design-engineering/fallback/wireframes.mjs +114 -0
- package/src/core/design-engineering/figma/validators.mjs +178 -0
- package/src/core/design-engineering/index.mjs +9 -0
- package/src/core/design-engineering/visual-parity/capture.mjs +172 -0
- package/src/core/detect.mjs +220 -0
- package/src/core/docsgen.mjs +175 -0
- package/src/core/evidence.mjs +210 -0
- package/src/core/installer.mjs +377 -0
- package/src/core/manifest.mjs +53 -0
- package/src/core/paths.mjs +94 -0
- package/src/core/requirements/index.mjs +13 -0
- package/src/core/requirements/registry.mjs +234 -0
- package/src/core/resource-inventory.mjs +434 -0
- package/src/core/resources.mjs +280 -0
- package/src/core/security/threat-model.mjs +235 -0
- package/src/core/skills.mjs +353 -0
- package/src/core/source-skills.mjs +213 -0
- package/src/core/speckit.mjs +195 -0
- package/src/core/technology-decision/analyzer-deterministic.mjs +240 -0
- package/src/core/technology-decision/engine.mjs +157 -0
- package/src/core/technology-decision/generator.mjs +204 -0
- package/src/core/technology-decision/index.mjs +17 -0
- package/src/core/technology-decision/options/index.mjs +10 -0
- package/src/core/testplan.mjs +176 -0
- package/src/core/traceability/chain.mjs +488 -0
- package/src/core/traceability/index.mjs +12 -0
- package/src/core/workflow.mjs +471 -0
- package/src/util/args.mjs +69 -0
- package/src/util/frontmatter.mjs +26 -0
- package/src/util/fsx.mjs +208 -0
- package/src/util/logger.mjs +74 -0
- package/src/util/text.mjs +66 -0
- package/src/util/yaml.mjs +379 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-database-design
|
|
3
|
+
description: Design or review schemas, migrations, indexes and data access with attention to integrity, performance and reversibility. Use for any persistent data change.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: database-design
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [planning, implementation]
|
|
9
|
+
documents: [BACKEND, SECURITY, TRD]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF Database Design
|
|
13
|
+
|
|
14
|
+
## Procedure
|
|
15
|
+
|
|
16
|
+
1. Read the current schema and migrations. Do not design from memory.
|
|
17
|
+
2. Model entities, keys, relationships and invariants.
|
|
18
|
+
3. Decide nullability and defaults explicitly.
|
|
19
|
+
4. Write the migration with:
|
|
20
|
+
- forward path;
|
|
21
|
+
- lock/duration estimate for large tables;
|
|
22
|
+
- backfill strategy;
|
|
23
|
+
- rollback or compensating procedure;
|
|
24
|
+
- verification query.
|
|
25
|
+
5. Add indexes for real access patterns, with the query that justifies each one.
|
|
26
|
+
6. Review access privileges: the application role gets only what it needs.
|
|
27
|
+
7. Test on a disposable database: apply, verify, roll back.
|
|
28
|
+
|
|
29
|
+
## Safety rules
|
|
30
|
+
|
|
31
|
+
- Destructive changes require a backup and a human approval recorded in
|
|
32
|
+
`.aidf/evidence/`.
|
|
33
|
+
- Never edit an applied migration in a shared environment.
|
|
34
|
+
- Never run a migration against production from an agent session.
|
|
35
|
+
- Parameterise queries; never concatenate input.
|
|
36
|
+
|
|
37
|
+
## Output
|
|
38
|
+
|
|
39
|
+
- Schema/migration diff.
|
|
40
|
+
- Rollback procedure.
|
|
41
|
+
- Verification queries and their results.
|
|
42
|
+
- Residual risks (locks, downtime, data loss).
|
|
43
|
+
|
|
44
|
+
## Blocking conditions
|
|
45
|
+
|
|
46
|
+
- No backup path for a destructive change.
|
|
47
|
+
- A data ownership conflict with another service.
|
|
48
|
+
- An unverified assumption about production data volume.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-devops-engineering
|
|
3
|
+
description: Implement build, CI, deployment and observability changes with rollback and least privilege. Use for pipelines, containers, infrastructure and release automation.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: devops-engineering
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [implementation, release]
|
|
9
|
+
documents: [TRD, SECURITY, PLAN]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF DevOps Engineering
|
|
13
|
+
|
|
14
|
+
## Procedure
|
|
15
|
+
|
|
16
|
+
1. Read the current pipeline, Dockerfile, deployment manifests and environment
|
|
17
|
+
model. Do not introduce a second deployment path.
|
|
18
|
+
2. Define the change: build, test, artifact, deploy, verify, rollback.
|
|
19
|
+
3. Apply least privilege to tokens, service accounts and secrets.
|
|
20
|
+
4. Pin tool and action versions; avoid floating tags.
|
|
21
|
+
5. Add caching only when measured; do not hide correctness behind cache.
|
|
22
|
+
6. Make the pipeline fail closed: a failed test or scan blocks the deploy.
|
|
23
|
+
7. Verify on a branch or staging environment before production.
|
|
24
|
+
8. Document rollback and test it where feasible.
|
|
25
|
+
|
|
26
|
+
## Checklist
|
|
27
|
+
|
|
28
|
+
- [ ] Build is reproducible from a clean checkout.
|
|
29
|
+
- [ ] Tests run in CI with the same command as local.
|
|
30
|
+
- [ ] Secrets are injected, never committed.
|
|
31
|
+
- [ ] Artifact is versioned and traceable to a commit.
|
|
32
|
+
- [ ] Deployment has a health check and a rollback path.
|
|
33
|
+
- [ ] Logs and metrics are available after deploy.
|
|
34
|
+
- [ ] Permissions are scoped to the environment.
|
|
35
|
+
|
|
36
|
+
## Hard limits
|
|
37
|
+
|
|
38
|
+
- An agent must not deploy to production or change cloud permissions without
|
|
39
|
+
explicit human authorization.
|
|
40
|
+
- A green pipeline is not proof that the application is healthy; verify the
|
|
41
|
+
deployed behaviour.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-documentation-maintenance
|
|
3
|
+
description: Keep AIDF documents, decisions, changelog and traceability accurate after a change. Use at the end of every phase and when documentation drifts from code.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: documentation-maintenance
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [release, implementation]
|
|
9
|
+
documents: [CHANGELOG, DECISIONS, PRD, TRD]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF Documentation Maintenance
|
|
13
|
+
|
|
14
|
+
## Procedure
|
|
15
|
+
|
|
16
|
+
1. Compare the change with the documents it affects. Use the diff, not memory.
|
|
17
|
+
2. Update only what changed; do not rewrite stable sections.
|
|
18
|
+
3. For a behaviour change: update `PRD.md`/`APPFLOW.md`, then `TRD.md`/`BACKEND.md`
|
|
19
|
+
if the design changed.
|
|
20
|
+
4. For a decision: add or supersede an ADR in `DECISIONS.md`.
|
|
21
|
+
5. Add a `CHANGELOG.md` entry under `[Unreleased]`.
|
|
22
|
+
6. Update the status:
|
|
23
|
+
- `DRAFT` if not reviewed;
|
|
24
|
+
- `VALIDATED` only with a named human validator and evidence;
|
|
25
|
+
- `OUTDATED` when the document no longer matches reality;
|
|
26
|
+
- `BLOCKED` when a decision is missing;
|
|
27
|
+
- `NOT_APPLICABLE` with a reason.
|
|
28
|
+
7. Run `aidf validate --phase release --kind exit` to detect drift.
|
|
29
|
+
|
|
30
|
+
## Quality checks
|
|
31
|
+
|
|
32
|
+
- No claim without evidence or a labelled assumption.
|
|
33
|
+
- No duplicated source of truth with Spec Kit.
|
|
34
|
+
- Links and paths are real.
|
|
35
|
+
- Dates and versions are real, not placeholders.
|
|
36
|
+
|
|
37
|
+
## Output
|
|
38
|
+
|
|
39
|
+
- Document diff.
|
|
40
|
+
- Changelog entry.
|
|
41
|
+
- Updated statuses with validation records.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-frontend-implementation
|
|
3
|
+
description: Implement frontend changes that respect the existing design system, component patterns, state model and accessibility requirements. Use for UI features and fixes.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: frontend-implementation
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [implementation]
|
|
9
|
+
documents: [UI-UX, APPFLOW, CONVENTIONS]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF Frontend Implementation
|
|
13
|
+
|
|
14
|
+
## Before coding
|
|
15
|
+
|
|
16
|
+
1. Find the existing design system, component library and styling approach.
|
|
17
|
+
Reuse them; do not introduce a parallel one.
|
|
18
|
+
2. Locate the state model (local, store, server cache) and follow it.
|
|
19
|
+
3. Read `UI-UX.md` for the screen states and accessibility target.
|
|
20
|
+
4. Identify the test setup for components.
|
|
21
|
+
|
|
22
|
+
## Implementation rules
|
|
23
|
+
|
|
24
|
+
- Preserve the existing product surface and navigation.
|
|
25
|
+
- Implement loading, empty, error and success states.
|
|
26
|
+
- Use semantic HTML before ARIA. Label every form control.
|
|
27
|
+
- Keep focus visible; manage focus on route/modal changes.
|
|
28
|
+
- Do not hard-code user-facing strings that belong in the i18n layer.
|
|
29
|
+
- Do not fetch data in a component that already has a data owner.
|
|
30
|
+
- Avoid layout shift: reserve space for async content.
|
|
31
|
+
|
|
32
|
+
## Verification
|
|
33
|
+
|
|
34
|
+
- Component/unit tests for changed behaviour.
|
|
35
|
+
- Keyboard-only pass for interactive changes.
|
|
36
|
+
- Check contrast and reduced-motion behaviour when relevant.
|
|
37
|
+
- Record screenshots or test output as evidence.
|
|
38
|
+
|
|
39
|
+
## Anti-patterns
|
|
40
|
+
|
|
41
|
+
- Adding a dependency for a trivial utility.
|
|
42
|
+
- Copying a component instead of extending it.
|
|
43
|
+
- Styling by overriding global selectors.
|
|
44
|
+
- Declaring accessibility "done" without a check.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-phase-transition
|
|
3
|
+
description: Evaluate phase entry and exit gates, collect evidence and block transitions that are not demonstrated. Use before moving to another phase or declaring work complete.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: phase-transition
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [intake, discovery, specification, planning, implementation, testing, security, release]
|
|
9
|
+
documents: [PLAN, CHANGELOG]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF Phase Transition
|
|
13
|
+
|
|
14
|
+
## Procedure
|
|
15
|
+
|
|
16
|
+
1. Show the current state: `aidf workflow status`.
|
|
17
|
+
2. Enter the target phase: `aidf workflow enter <phase>`. If the entry gate is
|
|
18
|
+
not `PASS`, stop and report why.
|
|
19
|
+
3. Before leaving, run the exit gate:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
aidf validate --phase <phase> --kind exit --allow-exec
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
4. Read the gate report. Statuses are:
|
|
26
|
+
- `PASS` — all mandatory checks demonstrated;
|
|
27
|
+
- `FAIL` — a check ran and failed;
|
|
28
|
+
- `BLOCKED` — a mandatory condition cannot be evaluated (missing config,
|
|
29
|
+
contradiction, missing approval);
|
|
30
|
+
- `NOT_PROVEN` — no evidence was produced;
|
|
31
|
+
- `NOT_APPLICABLE` — the check does not apply, with a reason.
|
|
32
|
+
5. If the gate is not `PASS`, do not declare the phase complete. Fix the cause or
|
|
33
|
+
record the blocker.
|
|
34
|
+
6. On `PASS`, `aidf workflow exit <phase>` records the evidence and advances.
|
|
35
|
+
7. Update `PLAN.md` and `CHANGELOG.md` with the real state.
|
|
36
|
+
|
|
37
|
+
## Rules
|
|
38
|
+
|
|
39
|
+
- Never edit a gate result by hand.
|
|
40
|
+
- Never turn `NOT_PROVEN` into `PASS` because the work "looks done".
|
|
41
|
+
- A human approval is required for specification, plan, security and release.
|
|
42
|
+
- A blocked gate is a valid outcome; hiding it is not.
|
|
43
|
+
|
|
44
|
+
## Output
|
|
45
|
+
|
|
46
|
+
- Gate report with check-level detail.
|
|
47
|
+
- Evidence reference.
|
|
48
|
+
- Next action: fix, escalate, or proceed.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-product-analysis
|
|
3
|
+
description: Turn a raw request into product goals, users, scope and measurable outcomes without inventing facts. Use for new features, ambiguous requests, or PRD updates.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: product-analysis
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [intake, specification]
|
|
9
|
+
documents: [PRD, APPFLOW]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF Product Analysis
|
|
13
|
+
|
|
14
|
+
## Procedure
|
|
15
|
+
|
|
16
|
+
1. Restate the request in one sentence, using the user's vocabulary.
|
|
17
|
+
2. Identify the actor, the job to be done, and the observable outcome.
|
|
18
|
+
3. Separate:
|
|
19
|
+
- **Stated** by the user;
|
|
20
|
+
- **Observed** in the repository or analytics;
|
|
21
|
+
- **Assumed** — label it and propose a verification.
|
|
22
|
+
4. Write or update the PRD sections: context, goals, non-goals, personas,
|
|
23
|
+
functional requirements, non-functional requirements, metrics.
|
|
24
|
+
5. Give every requirement an ID (`FR-xxx`), a priority, an acceptance criterion
|
|
25
|
+
and a verification method.
|
|
26
|
+
6. List open questions with an owner and a needed-by date. Do not fill them with
|
|
27
|
+
guesses.
|
|
28
|
+
7. Identify security, privacy and data impacts; link to `SECURITY.md`.
|
|
29
|
+
|
|
30
|
+
## Quality bar
|
|
31
|
+
|
|
32
|
+
- A requirement without an acceptance criterion is not a requirement.
|
|
33
|
+
- A metric without a source of truth is a wish.
|
|
34
|
+
- A persona without evidence is an assumption.
|
|
35
|
+
- A non-goal is as important as a goal.
|
|
36
|
+
|
|
37
|
+
## Output
|
|
38
|
+
|
|
39
|
+
- Updated `PRD.md` (status stays `DRAFT` until a human validates it).
|
|
40
|
+
- A list of decisions needed from the product owner.
|
|
41
|
+
- A proposed scope for the current cycle.
|
|
42
|
+
|
|
43
|
+
## Anti-patterns
|
|
44
|
+
|
|
45
|
+
- Inventing users, market size or conversion numbers.
|
|
46
|
+
- Writing implementation details in the PRD.
|
|
47
|
+
- Expanding scope silently while "clarifying".
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-project-context
|
|
3
|
+
description: Discover the real project context before any change. Use at session start, when the stack is unknown, or when a task spans several areas. Produces a context manifest of verified facts, documents and skills.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: project-context
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [intake, discovery]
|
|
9
|
+
documents: [constitution, CONVENTIONS, TRD]
|
|
10
|
+
rules: [inspect-before-modify, no-assumption-as-fact]
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# AIDF Project Context
|
|
14
|
+
|
|
15
|
+
## When to use
|
|
16
|
+
|
|
17
|
+
- First message of a session in a project that uses AIDF.
|
|
18
|
+
- The request mentions an area you have not inspected.
|
|
19
|
+
- The stack, test command or deployment model is unclear.
|
|
20
|
+
- A previous answer was based on memory rather than the repository.
|
|
21
|
+
|
|
22
|
+
## Procedure
|
|
23
|
+
|
|
24
|
+
1. Run `aidf doctor` and `aidf scan --record`. If `aidf` is unavailable, use
|
|
25
|
+
`node .aidf/bin/aidf.mjs`.
|
|
26
|
+
2. Read `.aidf/docs/constitution.md` and `.aidf/docs/CONVENTIONS.md`.
|
|
27
|
+
3. Run `aidf context --task "<request>" --write .aidf/state/context/latest.md`.
|
|
28
|
+
4. Read the selected documents and skills only. Do not load everything.
|
|
29
|
+
5. Inspect the files relevant to the request: routes, services, schemas, tests,
|
|
30
|
+
configuration. Cite paths in your answer.
|
|
31
|
+
6. Separate:
|
|
32
|
+
- **Verified facts** (with file path or command output);
|
|
33
|
+
- **Assumptions** (labelled, with a way to verify);
|
|
34
|
+
- **Open questions** (with an owner).
|
|
35
|
+
|
|
36
|
+
## Output
|
|
37
|
+
|
|
38
|
+
A short context report containing:
|
|
39
|
+
|
|
40
|
+
- stack and runtime, with evidence;
|
|
41
|
+
- test/build commands, with evidence;
|
|
42
|
+
- architecture boundaries relevant to the task;
|
|
43
|
+
- selected documents and skills, with why;
|
|
44
|
+
- risks and unknowns.
|
|
45
|
+
|
|
46
|
+
## Hard rules
|
|
47
|
+
|
|
48
|
+
- Never read or print `.env`, keys, tokens or credential stores.
|
|
49
|
+
- Never claim a mechanism is active because a file exists. Activation must be
|
|
50
|
+
observed or marked `NOT_PROVEN`.
|
|
51
|
+
- Do not propose an architecture change during context discovery.
|
|
52
|
+
|
|
53
|
+
## Handoff
|
|
54
|
+
|
|
55
|
+
- Product framing → `aidf-product-analysis`
|
|
56
|
+
- Architecture question → `aidf-architecture-review`
|
|
57
|
+
- Ready to implement → `aidf-phase-transition` to check the phase gate.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-requirements-engineering
|
|
3
|
+
description: Write precise, testable requirements and acceptance criteria, and trace them to design, tasks and tests. Use when specifying a feature or reviewing requirement quality.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: requirements-engineering
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [specification, planning]
|
|
9
|
+
documents: [PRD, APPFLOW, PLAN]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF Requirements Engineering
|
|
13
|
+
|
|
14
|
+
## Requirement shape
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
FR-012 — <capability>
|
|
18
|
+
Given <context>
|
|
19
|
+
When <action>
|
|
20
|
+
Then <observable outcome>
|
|
21
|
+
And <invariant that must still hold>
|
|
22
|
+
Verification: <test id / command / manual review>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Procedure
|
|
26
|
+
|
|
27
|
+
1. Decompose the feature into independently verifiable behaviours.
|
|
28
|
+
2. For each behaviour, write the nominal path, boundary values, invalid input and
|
|
29
|
+
failure path.
|
|
30
|
+
3. Define acceptance criteria that a test can observe. Avoid "works correctly".
|
|
31
|
+
4. Build a traceability table:
|
|
32
|
+
|
|
33
|
+
| Requirement | Design | Task | Test | Evidence |
|
|
34
|
+
|---|---|---|---|---|
|
|
35
|
+
| FR-012 | BACKEND §2 | T-004 | tests/api.test.ts | evidence id |
|
|
36
|
+
|
|
37
|
+
5. Flag requirements that cannot be verified automatically, and state the manual
|
|
38
|
+
verification procedure.
|
|
39
|
+
6. Check for conflicts with `SECURITY.md` and existing `PRD.md` requirements.
|
|
40
|
+
|
|
41
|
+
## Quality checks
|
|
42
|
+
|
|
43
|
+
- No ambiguous pronouns ("it", "the system") without a defined referent.
|
|
44
|
+
- No hidden implementation choice in a product requirement.
|
|
45
|
+
- Every requirement is necessary; every necessary requirement is present.
|
|
46
|
+
- Edge cases are explicit, not left to the implementer.
|
|
47
|
+
|
|
48
|
+
## Output
|
|
49
|
+
|
|
50
|
+
- Requirements with acceptance criteria.
|
|
51
|
+
- Traceability table.
|
|
52
|
+
- A list of `NOT_PROVEN` requirements with the reason.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-security-review
|
|
3
|
+
description: Review a change for security and privacy risks using a threat-informed checklist and record findings with severity and evidence. Use before release and for any auth, data or input change.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: security-review
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [security, release]
|
|
9
|
+
documents: [SECURITY, BACKEND, DECISIONS]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF Security Review
|
|
13
|
+
|
|
14
|
+
## Scope
|
|
15
|
+
|
|
16
|
+
Review the actual diff and the affected trust boundaries. Do not review from the
|
|
17
|
+
description alone.
|
|
18
|
+
|
|
19
|
+
## Procedure
|
|
20
|
+
|
|
21
|
+
1. Identify assets, actors and trust boundaries touched by the change.
|
|
22
|
+
2. For each boundary, check: authentication, authorization, input validation,
|
|
23
|
+
output encoding, rate limiting, logging.
|
|
24
|
+
3. Check secrets: no secret in code, config, logs, errors, client bundle or test
|
|
25
|
+
fixtures.
|
|
26
|
+
4. Check dependencies added: origin, licence, maintenance, known advisories.
|
|
27
|
+
5. Check data: classification, retention, deletion, encryption, backup.
|
|
28
|
+
6. Run the configured audit command if one exists. If not, record
|
|
29
|
+
`NOT_APPLICABLE` with a reason.
|
|
30
|
+
7. Record findings:
|
|
31
|
+
|
|
32
|
+
| ID | Finding | Severity | Evidence | Mitigation | Status |
|
|
33
|
+
|---|---|---|---|---|---|
|
|
34
|
+
|
|
35
|
+
8. Record residual risk and require human acceptance for anything not fixed.
|
|
36
|
+
|
|
37
|
+
## Severity
|
|
38
|
+
|
|
39
|
+
- **Critical**: exploitable now, high impact (RCE, auth bypass, secret leak).
|
|
40
|
+
- **High**: likely exploitable, significant impact.
|
|
41
|
+
- **Medium**: requires conditions or has limited impact.
|
|
42
|
+
- **Low**: hardening.
|
|
43
|
+
|
|
44
|
+
A high or critical finding blocks the security gate until fixed or explicitly
|
|
45
|
+
accepted by a human with a recorded rationale.
|
|
46
|
+
|
|
47
|
+
## Hard limits
|
|
48
|
+
|
|
49
|
+
- AIDF does not certify the absence of vulnerabilities.
|
|
50
|
+
- A static checklist is not a penetration test.
|
|
51
|
+
- A passing scanner is not proof of security.
|
|
52
|
+
|
|
53
|
+
## Output
|
|
54
|
+
|
|
55
|
+
- Findings with severity and evidence.
|
|
56
|
+
- Residual risks with acceptance.
|
|
57
|
+
- Human approval evidence in `.aidf/evidence/`.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-testing-validation
|
|
3
|
+
description: Design and execute tests that prove the change, including failure paths, and record real command output as evidence. Use during implementation and before any phase exit.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: testing-validation
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [testing, implementation]
|
|
9
|
+
documents: [CONVENTIONS, PLAN]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF Testing and Validation
|
|
13
|
+
|
|
14
|
+
## Procedure
|
|
15
|
+
|
|
16
|
+
1. Identify the real test command from `package.json`, `pyproject.toml`, `Makefile`
|
|
17
|
+
or CI. Do not invent a command.
|
|
18
|
+
2. Run the focused test first, then the full suite.
|
|
19
|
+
3. Cover:
|
|
20
|
+
- nominal path;
|
|
21
|
+
- boundary values;
|
|
22
|
+
- invalid input;
|
|
23
|
+
- authorization failure;
|
|
24
|
+
- dependency failure;
|
|
25
|
+
- regression case.
|
|
26
|
+
4. Record the exact command, exit code, duration and output hash:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
aidf evidence capture --type test-run --note "focused + full suite"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
5. List what is not covered and why. Mark it `NOT_PROVEN`, not `PASS`.
|
|
33
|
+
6. If a test fails, fix the cause. Do not skip, weaken or delete a test to get a
|
|
34
|
+
green run unless the test itself is proven wrong and the decision is recorded.
|
|
35
|
+
|
|
36
|
+
## Evidence rules
|
|
37
|
+
|
|
38
|
+
- A mock is not an integration.
|
|
39
|
+
- A simulated run is not a real run.
|
|
40
|
+
- A test that was not executed is not evidence.
|
|
41
|
+
- A previous run does not prove the current diff.
|
|
42
|
+
- Screenshots supplement, but do not replace, executable tests.
|
|
43
|
+
|
|
44
|
+
## Output
|
|
45
|
+
|
|
46
|
+
- Test diff.
|
|
47
|
+
- Execution record with command and result.
|
|
48
|
+
- Coverage gaps and limitations.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aidf-ui-ux-implementation
|
|
3
|
+
description: Translate flows and design intent into interface structure, states and copy while preserving the existing product surface. Use before frontend coding.
|
|
4
|
+
metadata:
|
|
5
|
+
aidf:
|
|
6
|
+
id: ui-ux-implementation
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
phases: [specification, planning]
|
|
9
|
+
documents: [UI-UX, APPFLOW]
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# AIDF UI / UX Implementation
|
|
13
|
+
|
|
14
|
+
## Procedure
|
|
15
|
+
|
|
16
|
+
1. Map each flow in `APPFLOW.md` to screens and transitions.
|
|
17
|
+
2. For each screen, define: purpose, entry conditions, primary action,
|
|
18
|
+
secondary actions, exit paths.
|
|
19
|
+
3. Define all states: loading, empty, partial, error, success, disabled,
|
|
20
|
+
permission-denied.
|
|
21
|
+
4. Write microcopy for errors and empty states: what happened, what to do next.
|
|
22
|
+
5. Specify responsive behaviour and keyboard/focus order.
|
|
23
|
+
6. Check the design system: reuse tokens and components; list gaps explicitly.
|
|
24
|
+
7. Hand off to frontend implementation with a state matrix.
|
|
25
|
+
|
|
26
|
+
## State matrix
|
|
27
|
+
|
|
28
|
+
| Screen | Loading | Empty | Error | Success | Permission |
|
|
29
|
+
|---|---|---|---|---|---|
|
|
30
|
+
| `[screen]` | `[spec]` | `[spec]` | `[spec]` | `[spec]` | `[spec]` |
|
|
31
|
+
|
|
32
|
+
## Rules
|
|
33
|
+
|
|
34
|
+
- Never replace the project's existing cockpit or navigation model.
|
|
35
|
+
- Never invent a new visual language when one exists.
|
|
36
|
+
- Accessibility is part of the specification, not a later task.
|
|
37
|
+
- A flow without an error path is incomplete.
|
|
38
|
+
|
|
39
|
+
## Output
|
|
40
|
+
|
|
41
|
+
- Updated `UI-UX.md` and `APPFLOW.md`.
|
|
42
|
+
- State matrix and interaction notes.
|
|
43
|
+
- Open design decisions with an owner.
|