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.
Files changed (154) hide show
  1. package/CHANGELOG.md +174 -0
  2. package/INSTALLATION.md +140 -0
  3. package/LICENSE +21 -0
  4. package/QODER.md +88 -0
  5. package/README.md +142 -2
  6. package/UTILISATION.md +188 -0
  7. package/assets/adapters/qoder/agents/aidf-orchestrator.md +30 -0
  8. package/assets/adapters/qoder/rules/00-core.md +28 -0
  9. package/assets/adapters/qoder/rules/10-security.md +33 -0
  10. package/assets/adapters/qoder/rules/20-context.md +39 -0
  11. package/assets/core/AGENTS.fragment.md +18 -0
  12. package/assets/core/AIDF.md +107 -0
  13. package/assets/docs/APPFLOW.md +66 -0
  14. package/assets/docs/BACKEND.md +71 -0
  15. package/assets/docs/CHANGELOG.md +25 -0
  16. package/assets/docs/CONVENTIONS.md +95 -0
  17. package/assets/docs/DECISIONS.md +60 -0
  18. package/assets/docs/PLAN.md +53 -0
  19. package/assets/docs/PRD.md +88 -0
  20. package/assets/docs/SECURITY.md +94 -0
  21. package/assets/docs/TRD.md +78 -0
  22. package/assets/docs/UI-UX.md +71 -0
  23. package/assets/docs/constitution.md +86 -0
  24. package/assets/hooks/audit.mjs +45 -0
  25. package/assets/hooks/session-context.mjs +53 -0
  26. package/assets/integrations/spec-kit/mapping.yaml +92 -0
  27. package/assets/knowledge/best-practices/testing.md +53 -0
  28. package/assets/knowledge/best-practices/web-dev-baseline.md +39 -0
  29. package/assets/knowledge/rules/api.md +45 -0
  30. package/assets/knowledge/rules/sql.md +44 -0
  31. package/assets/knowledge/rules/typescript.md +50 -0
  32. package/assets/knowledge/security-references/owasp-baseline.md +58 -0
  33. package/assets/registry/activation-map.yaml +83 -0
  34. package/assets/registry/dependencies.yaml +35 -0
  35. package/assets/registry/skills.yaml +541 -0
  36. package/assets/registry/sources.yaml +396 -0
  37. package/assets/schemas/architecture/v1.json +110 -0
  38. package/assets/schemas/constraints/v1.json +93 -0
  39. package/assets/schemas/decision/v1.json +106 -0
  40. package/assets/schemas/discovery/v1.json +91 -0
  41. package/assets/schemas/requirement/v1.json +136 -0
  42. package/assets/schemas/security/threat-model/v1.json +127 -0
  43. package/assets/schemas/test-plan/v1.json +108 -0
  44. package/assets/skills/aidf-architecture-review/SKILL.md +49 -0
  45. package/assets/skills/aidf-backend-implementation/SKILL.md +47 -0
  46. package/assets/skills/aidf-database-design/SKILL.md +48 -0
  47. package/assets/skills/aidf-devops-engineering/SKILL.md +41 -0
  48. package/assets/skills/aidf-documentation-maintenance/SKILL.md +41 -0
  49. package/assets/skills/aidf-frontend-implementation/SKILL.md +44 -0
  50. package/assets/skills/aidf-phase-transition/SKILL.md +48 -0
  51. package/assets/skills/aidf-product-analysis/SKILL.md +47 -0
  52. package/assets/skills/aidf-project-context/SKILL.md +57 -0
  53. package/assets/skills/aidf-requirements-engineering/SKILL.md +52 -0
  54. package/assets/skills/aidf-security-review/SKILL.md +57 -0
  55. package/assets/skills/aidf-testing-validation/SKILL.md +48 -0
  56. package/assets/skills/aidf-ui-ux-implementation/SKILL.md +43 -0
  57. package/assets/workflows/gates.yaml +232 -0
  58. package/assets/workflows/phases.yaml +161 -0
  59. package/bin/aidf.mjs +12 -0
  60. package/demo/run-demo.mjs +97 -0
  61. package/docs/aidf/ADR-001-artefacts-architectur.md +126 -0
  62. package/docs/aidf/ADR-002-requirements-registry.md +145 -0
  63. package/docs/aidf/ADR-003-traceability-chain.md +145 -0
  64. package/docs/aidf/ADR-004-markdown-generation.md +134 -0
  65. package/docs/aidf/ADR-005-validation-and-tests.md +170 -0
  66. package/docs/aidf/ADR-006-cli-commands.md +189 -0
  67. package/docs/aidf/ADR-007-compatibility-and-migration.md +119 -0
  68. package/docs/aidf/ADR-008-schema-versioning.md +115 -0
  69. package/docs/aidf/ADR-009-artefacts-scope.md +84 -0
  70. package/docs/aidf/ARCHITECTURE.md +137 -0
  71. package/docs/aidf/COMPATIBILITY.md +90 -0
  72. package/docs/aidf/DECISIONS.md +200 -0
  73. package/docs/aidf/FRAMEWORK.md +38 -0
  74. package/docs/aidf/IDE-QODER.md +61 -0
  75. package/docs/aidf/INSTALL.md +99 -0
  76. package/docs/aidf/INVENTORY.md +72 -0
  77. package/docs/aidf/L1-ARCHITECTURE-RAPPORT.md +353 -0
  78. package/docs/aidf/LIMITATIONS.md +69 -0
  79. package/docs/aidf/MATRICE-0.1.0-vers-0.2.0.md +155 -0
  80. package/docs/aidf/SECURITY.md +86 -0
  81. package/docs/aidf/SKILLS.md +78 -0
  82. package/docs/aidf/SPECKIT.md +67 -0
  83. package/docs/aidf/USAGE.md +113 -0
  84. package/docs/aidf/VALIDATION.md +55 -0
  85. package/package.json +37 -4
  86. package/src/cli.mjs +148 -0
  87. package/src/commands/artefacts.mjs +129 -0
  88. package/src/commands/config.mjs +130 -0
  89. package/src/commands/context.mjs +55 -0
  90. package/src/commands/decision.mjs +142 -0
  91. package/src/commands/design.mjs +141 -0
  92. package/src/commands/docs.mjs +133 -0
  93. package/src/commands/doctor.mjs +210 -0
  94. package/src/commands/evidence.mjs +178 -0
  95. package/src/commands/install.mjs +154 -0
  96. package/src/commands/release.mjs +214 -0
  97. package/src/commands/requirements.mjs +196 -0
  98. package/src/commands/resources.mjs +181 -0
  99. package/src/commands/scan.mjs +139 -0
  100. package/src/commands/security.mjs +97 -0
  101. package/src/commands/setup.mjs +68 -0
  102. package/src/commands/skills.mjs +204 -0
  103. package/src/commands/speckit.mjs +78 -0
  104. package/src/commands/tests.mjs +81 -0
  105. package/src/commands/traceability.mjs +116 -0
  106. package/src/commands/uninstall.mjs +238 -0
  107. package/src/commands/validate.mjs +84 -0
  108. package/src/commands/workflow.mjs +137 -0
  109. package/src/core/adapters/base.mjs +32 -0
  110. package/src/core/adapters/generic.mjs +70 -0
  111. package/src/core/adapters/index.mjs +24 -0
  112. package/src/core/adapters/opencode.mjs +115 -0
  113. package/src/core/adapters/qoder.mjs +228 -0
  114. package/src/core/artefacts/index.mjs +1 -0
  115. package/src/core/artefacts/validation.mjs +161 -0
  116. package/src/core/bootstrap.mjs +179 -0
  117. package/src/core/config.mjs +123 -0
  118. package/src/core/context.mjs +187 -0
  119. package/src/core/design-engineering/complexity-classifier.mjs +78 -0
  120. package/src/core/design-engineering/engine.mjs +197 -0
  121. package/src/core/design-engineering/fallback/mockups.mjs +221 -0
  122. package/src/core/design-engineering/fallback/wireframes.mjs +114 -0
  123. package/src/core/design-engineering/figma/validators.mjs +178 -0
  124. package/src/core/design-engineering/index.mjs +9 -0
  125. package/src/core/design-engineering/visual-parity/capture.mjs +172 -0
  126. package/src/core/detect.mjs +220 -0
  127. package/src/core/docsgen.mjs +175 -0
  128. package/src/core/evidence.mjs +210 -0
  129. package/src/core/installer.mjs +377 -0
  130. package/src/core/manifest.mjs +53 -0
  131. package/src/core/paths.mjs +94 -0
  132. package/src/core/requirements/index.mjs +13 -0
  133. package/src/core/requirements/registry.mjs +234 -0
  134. package/src/core/resource-inventory.mjs +434 -0
  135. package/src/core/resources.mjs +280 -0
  136. package/src/core/security/threat-model.mjs +235 -0
  137. package/src/core/skills.mjs +353 -0
  138. package/src/core/source-skills.mjs +213 -0
  139. package/src/core/speckit.mjs +195 -0
  140. package/src/core/technology-decision/analyzer-deterministic.mjs +240 -0
  141. package/src/core/technology-decision/engine.mjs +157 -0
  142. package/src/core/technology-decision/generator.mjs +204 -0
  143. package/src/core/technology-decision/index.mjs +17 -0
  144. package/src/core/technology-decision/options/index.mjs +10 -0
  145. package/src/core/testplan.mjs +176 -0
  146. package/src/core/traceability/chain.mjs +488 -0
  147. package/src/core/traceability/index.mjs +12 -0
  148. package/src/core/workflow.mjs +471 -0
  149. package/src/util/args.mjs +69 -0
  150. package/src/util/frontmatter.mjs +26 -0
  151. package/src/util/fsx.mjs +208 -0
  152. package/src/util/logger.mjs +74 -0
  153. package/src/util/text.mjs +66 -0
  154. package/src/util/yaml.mjs +379 -0
@@ -0,0 +1,95 @@
1
+ ---
2
+ doc: CONVENTIONS
3
+ status: DRAFT
4
+ version: 0.2.0
5
+ source: aidf-template
6
+ ---
7
+
8
+ # Development Conventions
9
+
10
+ > **Status: DRAFT.** Conventions must reflect the repository's actual tooling.
11
+ > Where the repository already enforces a rule (lint, format, CI), point to the
12
+ > configuration instead of restating it.
13
+
14
+ ## 1. Repository structure
15
+
16
+ ```text
17
+ [TO FILL: real top-level structure with responsibilities]
18
+ ```
19
+
20
+ Rules:
21
+ - New code goes in the module that owns the concern; do not create parallel trees.
22
+ - Generated artefacts are not edited by hand.
23
+ - `[TO FILL]`
24
+
25
+ ## 2. Naming
26
+
27
+ | Element | Convention | Example | Enforced by |
28
+ |---|---|---|---|
29
+ | Files | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
30
+ | Directories | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
31
+ | Types/classes | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
32
+ | Functions/variables | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
33
+ | Tests | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
34
+ | Branches | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
35
+
36
+ ## 3. Language and framework rules
37
+
38
+ ### TypeScript / JavaScript
39
+ - `strict` mode: `[TO FILL: check tsconfig]`
40
+ - Module system: `[TO FILL]`
41
+ - Forbidden patterns: `[TO FILL: e.g. any without justification]`
42
+ - Error handling: `[TO FILL]`
43
+
44
+ ### Other languages
45
+ - `[TO FILL]`
46
+
47
+ ## 4. API and database conventions
48
+
49
+ - Endpoint naming: `[TO FILL]`
50
+ - Status codes and error shape: `[TO FILL]`
51
+ - Migration naming and reversibility: `[TO FILL]`
52
+ - Query and index review: `[TO FILL]`
53
+
54
+ ## 5. Testing conventions
55
+
56
+ - Test levels: unit / integration / contract / e2e
57
+ - Location: `[TO FILL]`
58
+ - Naming: `[TO FILL]`
59
+ - Determinism: no network or clock dependence unless explicitly controlled
60
+ - Required coverage for changed behaviour: `[TO FILL]`
61
+ - Test command: `[TO FILL]`
62
+ - A test that was not executed is `NOT_PROVEN`, never `PASS`.
63
+
64
+ ## 6. Git conventions
65
+
66
+ - Branch model: `[TO FILL]`
67
+ - Commit format: `[TO FILL]`
68
+ - Review requirements: `[TO FILL]`
69
+ - Never commit secrets, generated credentials, or local environment files.
70
+
71
+ ## 7. Documentation conventions
72
+
73
+ - Documents carry a status frontmatter (`DRAFT`, `VALIDATED`, `BLOCKED`, `OUTDATED`, `NOT_APPLICABLE`).
74
+ - Decisions are recorded in `DECISIONS.md`; document changes in `CHANGELOG.md`.
75
+ - Claims link to evidence (command, test, file, decision).
76
+
77
+ ## 8. Definition of Done
78
+
79
+ A change is done when:
80
+ 1. behaviour is specified and accepted;
81
+ 2. implementation is complete and reviewed;
82
+ 3. relevant tests pass and the command is recorded;
83
+ 4. security implications are reviewed;
84
+ 5. documentation and changelog are updated;
85
+ 6. evidence is stored in `.aidf/evidence/`;
86
+ 7. the phase exit gate is `PASS`.
87
+
88
+ ## 9. Tooling
89
+
90
+ | Tool | Purpose | Command | Config |
91
+ |---|---|---|---|
92
+ | `[TO FILL]` | lint | `[TO FILL]` | `[TO FILL]` |
93
+ | `[TO FILL]` | format | `[TO FILL]` | `[TO FILL]` |
94
+ | `[TO FILL]` | test | `[TO FILL]` | `[TO FILL]` |
95
+ | `[TO FILL]` | build | `[TO FILL]` | `[TO FILL]` |
@@ -0,0 +1,60 @@
1
+ ---
2
+ doc: DECISIONS
3
+ status: DRAFT
4
+ version: 0.2.0
5
+ source: aidf-template
6
+ ---
7
+
8
+ # Decision Log
9
+
10
+ Architecture, security and product decisions are recorded here. A decision is
11
+ never deleted; it is superseded.
12
+
13
+ ## Decision template
14
+
15
+ ```markdown
16
+ ## ADR-000 — Title
17
+
18
+ - Status: proposed | accepted | superseded | rejected | BLOCKED
19
+ - Date: YYYY-MM-DD
20
+ - Deciders: names/roles
21
+ - Related: PRD FR-xxx, TRD section, SECURITY T-xxx, Spec Kit feature
22
+
23
+ ### Context
24
+ What is the real situation and constraint? What evidence supports it?
25
+
26
+ ### Options considered
27
+ 1. Option A — pros / cons
28
+ 2. Option B — pros / cons
29
+
30
+ ### Decision
31
+ What was decided, precisely.
32
+
33
+ ### Consequences
34
+ Positive, negative, follow-up work, migration impact.
35
+
36
+ ### Evidence
37
+ Commands, links, reviews, approvals.
38
+ ```
39
+
40
+ ## ADR-001 — Adopt AIDF as the development governance layer
41
+
42
+ - Status: accepted (installed)
43
+ - Date: `[TO FILL: installation date]`
44
+ - Deciders: `[TO FILL]`
45
+
46
+ ### Context
47
+ AI-assisted changes need explicit context, reproducible controls and evidence.
48
+ The project already has its own architecture and interface.
49
+
50
+ ### Decision
51
+ AIDF is installed as a governance layer under `.aidf/`. It does not impose an
52
+ application architecture and does not replace the project's cockpit.
53
+
54
+ ### Consequences
55
+ - Documents and gates become part of the delivery process.
56
+ - The team must keep document statuses honest and record evidence.
57
+ - AIDF updates are explicit and conflict-aware.
58
+
59
+ ### Evidence
60
+ `.aidf/manifest.json`, `.aidf/config.json`, installation report.
@@ -0,0 +1,53 @@
1
+ ---
2
+ doc: PLAN
3
+ status: DRAFT
4
+ version: 0.2.0
5
+ source: aidf-template
6
+ ---
7
+
8
+ # Delivery Plan
9
+
10
+ > **Status: DRAFT.** Phases, dates and estimates must come from a real planning
11
+ > decision. Do not fabricate dates or velocity.
12
+
13
+ ## 1. Current phase
14
+
15
+ - AIDF workflow phase: `[TO FILL: aidf workflow status]`
16
+ - Milestone: `[TO FILL]`
17
+ - Target date: `[TO FILL]`
18
+
19
+ ## 2. Phases and milestones
20
+
21
+ | Phase | Objective | Entry criteria | Exit criteria | Status | Evidence |
22
+ |---|---|---|---|---|---|
23
+ | P-001 | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | planned / active / done | `[TO FILL]` |
24
+
25
+ ## 3. Work breakdown
26
+
27
+ | ID | Task | Phase | Depends on | Owner | Estimate | Status | Acceptance |
28
+ |---|---|---|---|---|---|---|---|
29
+ | T-001 | `[TO FILL]` | `[TO FILL]` | — | `[TO FILL]` | `[TO FILL]` | todo | `[TO FILL]` |
30
+
31
+ ## 4. Dependencies and critical path
32
+
33
+ - `[TO FILL]`
34
+
35
+ ## 5. Risks and mitigations
36
+
37
+ | ID | Risk | Impact | Mitigation | Owner | Status |
38
+ |---|---|---|---|---|---|
39
+ | P-R1 | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | open |
40
+
41
+ ## 6. Spec Kit linkage
42
+
43
+ | AIDF item | Spec Kit artefact | Path | Status |
44
+ |---|---|---|---|
45
+ | Feature spec | `spec.md` | `specs/<feature>/spec.md` | `[TO FILL]` |
46
+ | Technical plan | `plan.md` | `specs/<feature>/plan.md` | `[TO FILL]` |
47
+ | Tasks | `tasks.md` | `specs/<feature>/tasks.md` | `[TO FILL]` |
48
+
49
+ ## 7. Change log
50
+
51
+ | Date | Change | Reason | Decision |
52
+ |---|---|---|---|
53
+ | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
@@ -0,0 +1,88 @@
1
+ ---
2
+ doc: PRD
3
+ status: DRAFT
4
+ version: 0.2.0
5
+ source: aidf-template
6
+ ---
7
+
8
+ # Product Requirements Document (PRD)
9
+
10
+ > **Status: DRAFT.** Every statement below must be grounded in the repository,
11
+ > a stakeholder decision, or an explicit assumption. Replace `[TO FILL]` only
12
+ > with verified content. Do not invent users, metrics or constraints.
13
+
14
+ ## 1. Product context
15
+
16
+ - Product name: `[TO FILL or read from README/package.json]`
17
+ - Problem statement: `[TO FILL]`
18
+ - Target users and segments: `[TO FILL]`
19
+ - Current alternatives: `[TO FILL]`
20
+
21
+ ## 2. Goals and non-goals
22
+
23
+ ### Goals
24
+ - `[TO FILL: outcome + measurable indicator]`
25
+
26
+ ### Non-goals
27
+ - `[TO FILL]`
28
+
29
+ ## 3. Personas and jobs to be done
30
+
31
+ | Persona | Job to be done | Pain today | Evidence |
32
+ |---|---|---|---|
33
+ | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL: interview, ticket, analytics]` |
34
+
35
+ ## 4. User journeys (summary)
36
+
37
+ Reference `APPFLOW.md` for the detailed flows. Summarise here only the journeys
38
+ that define the product.
39
+
40
+ 1. `[TO FILL]`
41
+
42
+ ## 5. Functional requirements
43
+
44
+ Use stable identifiers (`FR-001`). Each requirement must have an acceptance
45
+ criterion and a verification method.
46
+
47
+ | ID | Requirement | Priority | Acceptance criterion | Verification |
48
+ |---|---|---|---|---|
49
+ | FR-001 | `[TO FILL]` | must / should / could | `[TO FILL]` | test / review / manual |
50
+
51
+ ## 6. Non-functional requirements
52
+
53
+ | ID | Category | Requirement | Target | Verification |
54
+ |---|---|---|---|---|
55
+ | NFR-001 | performance | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
56
+ | NFR-002 | accessibility | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
57
+ | NFR-003 | security | see `SECURITY.md` | `[TO FILL]` | `[TO FILL]` |
58
+
59
+ ## 7. Success metrics
60
+
61
+ | Metric | Definition | Baseline | Target | Source of truth |
62
+ |---|---|---|---|---|
63
+ | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
64
+
65
+ ## 8. Constraints and dependencies
66
+
67
+ - `[TO FILL: regulatory, contractual, technical, budget]`
68
+
69
+ ## 9. Open questions
70
+
71
+ | ID | Question | Owner | Needed by | Status |
72
+ |---|---|---|---|---|
73
+ | Q-001 | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | open |
74
+
75
+ ## 10. Traceability
76
+
77
+ - Spec Kit feature specs: `specs/<feature>/spec.md`
78
+ - Architecture: `TRD.md`
79
+ - Flows: `APPFLOW.md`
80
+ - Decisions: `DECISIONS.md`
81
+
82
+ ## 11. Validation record
83
+
84
+ | Field | Value |
85
+ |---|---|
86
+ | Validated by | `[TO FILL]` |
87
+ | Date | `[TO FILL]` |
88
+ | Evidence reviewed | `[TO FILL]` |
@@ -0,0 +1,94 @@
1
+ ---
2
+ doc: SECURITY
3
+ status: DRAFT
4
+ version: 0.2.0
5
+ source: aidf-template
6
+ ---
7
+
8
+ # Security Specification
9
+
10
+ > **Status: DRAFT.** This is a working security baseline, not a certification.
11
+ > No absence of vulnerabilities is claimed. Validate each control against the
12
+ > real deployment.
13
+
14
+ ## 1. Assets and data classification
15
+
16
+ | Asset | Classification | Owner | Storage | Retention | Notes |
17
+ |---|---|---|---|---|---|
18
+ | `[TO FILL]` | public / internal / confidential / restricted | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
19
+
20
+ ## 2. Trust boundaries and threat model
21
+
22
+ ```text
23
+ [TO FILL: users -> edge -> app -> services -> data, with trust boundaries]
24
+ ```
25
+
26
+ | ID | Threat | STRIDE | Asset | Likelihood | Impact | Mitigation | Status |
27
+ |---|---|---|---|---|---|---|---|
28
+ | T-001 | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | low/med/high | low/med/high | `[TO FILL]` | open |
29
+
30
+ ## 3. Authentication and authorization
31
+
32
+ - Authentication mechanism: `[TO FILL]`
33
+ - Session/token lifetime and rotation: `[TO FILL]`
34
+ - Authorization model (RBAC/ABAC/ownership): `[TO FILL]`
35
+ - Server-side enforcement points: `[TO FILL]`
36
+ - Deny-by-default behaviour: `[TO FILL]`
37
+
38
+ ## 4. Input, output and data protection
39
+
40
+ | Control | Implementation | Verification | Status |
41
+ |---|---|---|---|
42
+ | Input validation | `[TO FILL]` | tests | NOT_PROVEN |
43
+ | Output encoding | `[TO FILL]` | tests/review | NOT_PROVEN |
44
+ | SQL/NoSQL injection prevention | `[TO FILL]` | tests/review | NOT_PROVEN |
45
+ | Path traversal prevention | `[TO FILL]` | tests | NOT_PROVEN |
46
+ | SSRF protection | `[TO FILL]` | review | NOT_PROVEN |
47
+ | File upload controls | `[TO FILL]` | tests | NOT_PROVEN |
48
+ | Secrets management | `[TO FILL]` | review | NOT_PROVEN |
49
+ | Encryption in transit/at rest | `[TO FILL]` | config review | NOT_PROVEN |
50
+
51
+ ## 5. Dependencies and supply chain
52
+
53
+ - Lockfile policy: `[TO FILL]`
54
+ - Audit command: `[TO FILL: e.g. npm audit --omit=dev]`
55
+ - Update policy: `[TO FILL]`
56
+ - Provenance requirements for external resources: see `.aidf/registry/resources.lock.json`
57
+
58
+ ## 6. Logging, monitoring and incident response
59
+
60
+ - Security events logged: `[TO FILL]`
61
+ - Sensitive data excluded from logs: `[TO FILL]`
62
+ - Alerting: `[TO FILL]`
63
+ - Incident contact and escalation: `[TO FILL]`
64
+
65
+ ## 7. Compliance and privacy
66
+
67
+ | Requirement | Applicability | Implementation | Evidence |
68
+ |---|---|---|---|
69
+ | `[TO FILL]` | applicable / NOT_APPLICABLE | `[TO FILL]` | `[TO FILL]` |
70
+
71
+ ## 8. Human validation requirements
72
+
73
+ The following operations require explicit human approval before execution:
74
+
75
+ - production data migration or deletion;
76
+ - credential or permission changes;
77
+ - dependency addition from an unverified source;
78
+ - release to production;
79
+ - `[TO FILL: project-specific]`
80
+
81
+ ## 9. Residual risks
82
+
83
+ | ID | Risk | Accepted by | Date | Rationale |
84
+ |---|---|---|---|---|
85
+ | RR-001 | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
86
+
87
+ ## 10. Validation record
88
+
89
+ | Field | Value |
90
+ |---|---|
91
+ | Security reviewer | `[TO FILL]` |
92
+ | Date | `[TO FILL]` |
93
+ | Checks executed | `[TO FILL]` |
94
+ | Limitations | `[TO FILL]` |
@@ -0,0 +1,78 @@
1
+ ---
2
+ doc: TRD
3
+ status: DRAFT
4
+ version: 0.2.0
5
+ source: aidf-template
6
+ ---
7
+
8
+ # Technical Requirements Document (TRD)
9
+
10
+ > **Status: DRAFT.** Describe the architecture that exists or that has been
11
+ > explicitly decided. Never present a proposed design as implemented.
12
+
13
+ ## 1. System overview
14
+
15
+ - System purpose: `[TO FILL]`
16
+ - Runtime/deployment model: `[TO FILL: read from repo, CI, Dockerfile, hosting config]`
17
+ - Repository layout: `[TO FILL]`
18
+
19
+ ## 2. Technology stack (detected vs decided)
20
+
21
+ | Layer | Technology | Version | Evidence (file) | Status |
22
+ |---|---|---|---|---|
23
+ | Language | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | detected / decided |
24
+ | Framework | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | detected / decided |
25
+ | Database | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | detected / decided |
26
+ | Runtime | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | detected / decided |
27
+
28
+ ## 3. Architecture
29
+
30
+ ```text
31
+ [TO FILL: component diagram in text or Mermaid, grounded in real directories]
32
+ ```
33
+
34
+ ### Components and responsibilities
35
+
36
+ | Component | Responsibility | Owns data? | Interfaces | Source path |
37
+ |---|---|---|---|---|
38
+ | `[TO FILL]` | `[TO FILL]` | yes/no | `[TO FILL]` | `[TO FILL]` |
39
+
40
+ ## 4. Data architecture
41
+
42
+ - Primary data stores: `[TO FILL]`
43
+ - Ownership and boundaries: `[TO FILL]`
44
+ - Migrations strategy: `[TO FILL]`
45
+ - Retention and deletion: `[TO FILL]`
46
+
47
+ ## 5. Interfaces and contracts
48
+
49
+ | Interface | Type | Producer | Consumer | Contract location | Versioning |
50
+ |---|---|---|---|---|---|
51
+ | `[TO FILL]` | HTTP / event / CLI / DB | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
52
+
53
+ ## 6. Cross-cutting concerns
54
+
55
+ - Configuration and environments: `[TO FILL]`
56
+ - Logging and observability: `[TO FILL]`
57
+ - Error handling and retries: `[TO FILL]`
58
+ - Performance and capacity: `[TO FILL]`
59
+ - Accessibility and i18n: `[TO FILL]`
60
+ - Build, release and rollback: `[TO FILL]`
61
+
62
+ ## 7. Technical risks
63
+
64
+ | ID | Risk | Impact | Likelihood | Mitigation | Owner | Status |
65
+ |---|---|---|---|---|---|---|
66
+ | R-001 | `[TO FILL]` | high/med/low | high/med/low | `[TO FILL]` | `[TO FILL]` | open |
67
+
68
+ ## 8. Architecture decisions
69
+
70
+ Link to `DECISIONS.md`. Do not duplicate decision rationale here.
71
+
72
+ ## 9. Validation record
73
+
74
+ | Field | Value |
75
+ |---|---|
76
+ | Validated by | `[TO FILL]` |
77
+ | Date | `[TO FILL]` |
78
+ | Evidence reviewed | `[TO FILL]` |
@@ -0,0 +1,71 @@
1
+ ---
2
+ doc: UI-UX
3
+ status: DRAFT
4
+ version: 0.2.0
5
+ source: aidf-template
6
+ ---
7
+
8
+ # UI / UX Specification
9
+
10
+ > **Status: DRAFT.** Describe the existing interface or an approved design.
11
+ > Never declare accessibility conformance without an audit.
12
+
13
+ ## 1. Design principles
14
+
15
+ - `[TO FILL: grounded in the product, not generic slogans]`
16
+
17
+ ## 2. Design system
18
+
19
+ | Token / component | Value / location | Source | Status |
20
+ |---|---|---|---|
21
+ | Colour palette | `[TO FILL]` | `[TO FILL]` | existing / proposed |
22
+ | Typography | `[TO FILL]` | `[TO FILL]` | existing / proposed |
23
+ | Spacing scale | `[TO FILL]` | `[TO FILL]` | existing / proposed |
24
+ | Components | `[TO FILL]` | `[TO FILL]` | existing / proposed |
25
+
26
+ ## 3. Screens and states
27
+
28
+ For each screen, document loading, empty, error, partial and success states.
29
+
30
+ | Screen | Route | Purpose | States covered | Evidence |
31
+ |---|---|---|---|---|
32
+ | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | loading/empty/error/success | `[TO FILL]` |
33
+
34
+ ## 4. Interaction rules
35
+
36
+ - Navigation model: `[TO FILL]`
37
+ - Feedback and latency: `[TO FILL]`
38
+ - Destructive actions and confirmations: `[TO FILL]`
39
+ - Keyboard and focus order: `[TO FILL]`
40
+
41
+ ## 5. Accessibility
42
+
43
+ Target: `[TO FILL: e.g. WCAG 2.2 AA]`
44
+
45
+ | Requirement | Implementation | Verification | Status |
46
+ |---|---|---|---|
47
+ | Colour contrast | `[TO FILL]` | automated + manual | NOT_PROVEN |
48
+ | Keyboard navigation | `[TO FILL]` | manual | NOT_PROVEN |
49
+ | Screen reader semantics | `[TO FILL]` | manual | NOT_PROVEN |
50
+ | Reduced motion | `[TO FILL]` | manual | NOT_PROVEN |
51
+ | Form labels and errors | `[TO FILL]` | automated + manual | NOT_PROVEN |
52
+
53
+ ## 6. Responsive behaviour
54
+
55
+ | Breakpoint | Layout | Navigation | Known limitations |
56
+ |---|---|---|---|
57
+ | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` | `[TO FILL]` |
58
+
59
+ ## 7. Content and microcopy
60
+
61
+ - Tone: `[TO FILL]`
62
+ - Error message pattern: `[TO FILL]`
63
+ - Localisation: `[TO FILL]`
64
+
65
+ ## 8. Validation record
66
+
67
+ | Field | Value |
68
+ |---|---|
69
+ | Validated by | `[TO FILL]` |
70
+ | Date | `[TO FILL]` |
71
+ | Accessibility evidence | `[TO FILL]` |
@@ -0,0 +1,86 @@
1
+ ---
2
+ doc: constitution
3
+ status: DRAFT
4
+ version: 0.2.0
5
+ source: aidf-template
6
+ ---
7
+
8
+ # Project Constitution
9
+
10
+ > Ratified by: `[TO FILL: name and role]`
11
+ > Ratification date: `[TO FILL]`
12
+ > Amendment procedure: `[TO FILL: who can amend, review required]`
13
+
14
+ This constitution defines the non-negotiable principles of the project. It is
15
+ installed by AIDF as a starting point and must be reviewed and ratified by a
16
+ human. Until ratification it remains `DRAFT`; it is still binding as a default
17
+ safety baseline.
18
+
19
+ ## Article I — Evidence over assertion
20
+
21
+ A claim about behaviour, quality, security or completeness must be backed by a
22
+ verifiable artefact: a command and its output, a test result, a file diff, a
23
+ review record, or a human decision. Declarations by an agent are not evidence.
24
+
25
+ - A simulated test is not a real test.
26
+ - A mock is not an integration.
27
+ - Documentation is not implementation.
28
+ - A file's presence is not proof that a mechanism is activated.
29
+
30
+ ## Article II — Inspect before modifying
31
+
32
+ No change is made before reading the real code, configuration, tests and git
33
+ state relevant to the change. Assumptions are labelled as assumptions.
34
+
35
+ ## Article III — Security and privacy first
36
+
37
+ - Secrets are never read, printed, logged or committed.
38
+ - Least privilege applies to tools, tokens and automation.
39
+ - Inputs are validated; paths are constrained; downloaded content is untrusted.
40
+ - No external script is executed automatically without an explicit policy and
41
+ human authorization.
42
+ - Sensitive operations require human validation as defined by the project.
43
+
44
+ ## Article IV — The project owns its architecture
45
+
46
+ AIDF adapts to the host project. It never imposes a new application
47
+ architecture, replaces the project's cockpit, or creates a competing interface.
48
+ For projects with an existing product surface (for example KelyOS/ARIA), the
49
+ existing architecture and interface are authoritative.
50
+
51
+ ## Article V — Explicit state, explicit gates
52
+
53
+ Work moves through phases with declared entry and exit criteria. A phase is not
54
+ `PASS` unless its mandatory criteria are demonstrated. Blocked work is reported
55
+ as blocked, never hidden behind optimistic language.
56
+
57
+ ## Article VI — Traceable decisions
58
+
59
+ Architectural, security and product decisions are recorded in
60
+ `.aidf/docs/DECISIONS.md` with context, options, decision, consequences and
61
+ status. Superseded decisions are marked, not deleted.
62
+
63
+ ## Article VII — Human accountability
64
+
65
+ Humans remain accountable for product decisions, risk acceptance, sensitive
66
+ operations and release approval. AIDF reduces error and makes controls
67
+ reproducible; it does not replace a senior engineer or guarantee the absence of
68
+ vulnerabilities.
69
+
70
+ ## Article VIII — Proportionality
71
+
72
+ Documentation, skills and controls are loaded in proportion to the task. AIDF
73
+ selects context instead of flooding the agent with every document and skill.
74
+ Unused process is removed or marked `NOT_APPLICABLE`, not performed for show.
75
+
76
+ ## Article IX — Licences and provenance
77
+
78
+ External resources are recorded with origin, licence, version or commit, and
79
+ retrieval date. Redistribution respects the licence. Unknown provenance is
80
+ `BLOCKED` for installation.
81
+
82
+ ## Article X — Amendment
83
+
84
+ Amendments require a written proposal, a recorded decision, and human
85
+ ratification. Amendments that weaken Articles I, III or IV require an explicit
86
+ security and architecture review.
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Qoder PostToolUse hook: append a redacted audit record for file edits.
4
+ * Only metadata is stored: event, tool, file path relative to cwd, timestamp.
5
+ * Tool input and file content are never logged (they may contain secrets).
6
+ * Never blocks. Fails open.
7
+ */
8
+ import fs from 'node:fs';
9
+ import path from 'node:path';
10
+
11
+ function readStdin() {
12
+ try {
13
+ return fs.readFileSync(0, 'utf8');
14
+ } catch {
15
+ return '';
16
+ }
17
+ }
18
+
19
+ try {
20
+ const raw = readStdin();
21
+ const input = JSON.parse(raw || '{}');
22
+ const cwd = input.cwd || process.env.QODER_CWD || process.cwd();
23
+ const logDir = path.join(cwd, '.aidf', 'logs');
24
+ fs.mkdirSync(logDir, { recursive: true });
25
+ const date = new Date().toISOString().slice(0, 10);
26
+ const file = path.join(logDir, `audit-${date}.jsonl`);
27
+ const rawPath = input.tool_input?.file_path || input.tool_input?.path || process.env.QODER_TOOL_INPUT_FILE_PATH || '';
28
+ let relative = '';
29
+ try {
30
+ relative = rawPath ? path.relative(cwd, path.resolve(cwd, rawPath)).replace(/\\/g, '/') : '';
31
+ } catch {
32
+ relative = '';
33
+ }
34
+ const record = {
35
+ ts: new Date().toISOString(),
36
+ event: input.hook_event_name || 'PostToolUse',
37
+ tool: input.tool_name || process.env.QODER_TOOL_NAME || 'unknown',
38
+ file: relative.slice(0, 300),
39
+ session: String(input.session_id || '').slice(0, 64),
40
+ };
41
+ fs.appendFileSync(file, `${JSON.stringify(record)}\n`, 'utf8');
42
+ process.exit(0);
43
+ } catch {
44
+ process.exit(0);
45
+ }