aiadev 0.11.0__py3-none-any.whl

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 (90) hide show
  1. aiadev/__init__.py +19 -0
  2. aiadev/__main__.py +5 -0
  3. aiadev/_assets/agents/README.md +63 -0
  4. aiadev/_assets/agents/code-reviewer.md +101 -0
  5. aiadev/_assets/agents/plan-document-reviewer.md +93 -0
  6. aiadev/_assets/agents/spec-document-reviewer.md +78 -0
  7. aiadev/_assets/constitution.md +145 -0
  8. aiadev/_assets/presets/catalog.json +30 -0
  9. aiadev/_assets/presets/django-drf-react/CLAUDE.md +123 -0
  10. aiadev/_assets/presets/django-drf-react/constitution.md +106 -0
  11. aiadev/_assets/presets/django-drf-react/preset.yaml +55 -0
  12. aiadev/_assets/presets/django-drf-react/skills/ai-integration/SKILL.md +259 -0
  13. aiadev/_assets/presets/django-drf-react/skills/autodev-pipeline/SKILL.md +202 -0
  14. aiadev/_assets/presets/django-drf-react/skills/celery-async/SKILL.md +259 -0
  15. aiadev/_assets/presets/django-drf-react/skills/deploy/SKILL.md +158 -0
  16. aiadev/_assets/presets/django-drf-react/skills/django-patterns/SKILL.md +300 -0
  17. aiadev/_assets/presets/django-drf-react/skills/run-tests/SKILL.md +97 -0
  18. aiadev/_assets/presets/lean/CLAUDE.md +55 -0
  19. aiadev/_assets/presets/lean/preset.yaml +18 -0
  20. aiadev/_assets/presets/mobile-ops/CLAUDE.md +86 -0
  21. aiadev/_assets/presets/mobile-ops/preset.yaml +80 -0
  22. aiadev/_assets/presets/mobile-ops/skills/build-android/SKILL.md +31 -0
  23. aiadev/_assets/presets/mobile-ops/skills/build-ios/SKILL.md +37 -0
  24. aiadev/_assets/presets/mobile-ops/skills/bump-version/SKILL.md +41 -0
  25. aiadev/_assets/presets/mobile-ops/skills/deploy-admin/SKILL.md +54 -0
  26. aiadev/_assets/presets/mobile-ops/skills/deploy-backend/SKILL.md +67 -0
  27. aiadev/_assets/presets/mobile-ops/skills/ota-update/SKILL.md +41 -0
  28. aiadev/_assets/presets/mobile-ops/skills/release-notes/SKILL.md +47 -0
  29. aiadev/_assets/presets/mobile-ops/skills/run-tests/SKILL.md +53 -0
  30. aiadev/_assets/presets/mobile-ops/skills/start-dev/SKILL.md +56 -0
  31. aiadev/_assets/presets/mobile-ops/skills/submit-android/SKILL.md +33 -0
  32. aiadev/_assets/presets/mobile-ops/skills/submit-ios/SKILL.md +36 -0
  33. aiadev/_assets/schemas/extension-manifest.schema.json +37 -0
  34. aiadev/_assets/schemas/install-manifest.schema.json +74 -0
  35. aiadev/_assets/schemas/mcps.schema.json +43 -0
  36. aiadev/_assets/schemas/preset-catalog.schema.json +35 -0
  37. aiadev/_assets/schemas/skill-frontmatter.schema.json +93 -0
  38. aiadev/_assets/skills/analyze/SKILL.md +57 -0
  39. aiadev/_assets/skills/checklist/SKILL.md +51 -0
  40. aiadev/_assets/skills/clarify/SKILL.md +47 -0
  41. aiadev/_assets/skills/constitution/SKILL.md +53 -0
  42. aiadev/_assets/skills/finishing-a-branch/SKILL.md +133 -0
  43. aiadev/_assets/skills/frontend-design/SKILL.md +132 -0
  44. aiadev/_assets/skills/implement/SKILL.md +158 -0
  45. aiadev/_assets/skills/plan/SKILL.md +63 -0
  46. aiadev/_assets/skills/requesting-code-review/SKILL.md +111 -0
  47. aiadev/_assets/skills/specify/SKILL.md +52 -0
  48. aiadev/_assets/skills/systematic-debugging/SKILL.md +191 -0
  49. aiadev/_assets/skills/tasks/SKILL.md +57 -0
  50. aiadev/_assets/skills/test-driven-development/SKILL.md +181 -0
  51. aiadev/_assets/skills/using-ai-augmented-developer/SKILL.md +67 -0
  52. aiadev/_assets/skills/using-ai-augmented-developer/references/gemini-tools.md +30 -0
  53. aiadev/_assets/templates/README.md +37 -0
  54. aiadev/_assets/templates/agent-file-template.md +70 -0
  55. aiadev/_assets/templates/checklist-template.md +72 -0
  56. aiadev/_assets/templates/commands/command-template.md +48 -0
  57. aiadev/_assets/templates/constitution-template.md +73 -0
  58. aiadev/_assets/templates/plan-template.md +100 -0
  59. aiadev/_assets/templates/spec-template.md +88 -0
  60. aiadev/_assets/templates/tasks-template.md +72 -0
  61. aiadev/cli.py +30 -0
  62. aiadev/commands/__init__.py +0 -0
  63. aiadev/commands/doctor.py +94 -0
  64. aiadev/commands/extension.py +84 -0
  65. aiadev/commands/init.py +193 -0
  66. aiadev/commands/install.py +306 -0
  67. aiadev/commands/sync.py +271 -0
  68. aiadev/commands/validate.py +52 -0
  69. aiadev/extensions.py +299 -0
  70. aiadev/framework_artifacts.py +84 -0
  71. aiadev/install_engine.py +369 -0
  72. aiadev/install_manifest.py +220 -0
  73. aiadev/mcp.py +123 -0
  74. aiadev/paths.py +119 -0
  75. aiadev/placeholders.py +48 -0
  76. aiadev/platforms/__init__.py +13 -0
  77. aiadev/platforms/claude_code.py +163 -0
  78. aiadev/platforms/codex.py +154 -0
  79. aiadev/platforms/cursor.py +129 -0
  80. aiadev/platforms/gemini.py +210 -0
  81. aiadev/platforms/opencode.py +132 -0
  82. aiadev/project_introspect.py +298 -0
  83. aiadev/validate.py +132 -0
  84. aiadev/variable_prompt.py +130 -0
  85. aiadev-0.11.0.dist-info/METADATA +270 -0
  86. aiadev-0.11.0.dist-info/RECORD +90 -0
  87. aiadev-0.11.0.dist-info/WHEEL +5 -0
  88. aiadev-0.11.0.dist-info/entry_points.txt +2 -0
  89. aiadev-0.11.0.dist-info/licenses/LICENSE +21 -0
  90. aiadev-0.11.0.dist-info/top_level.txt +1 -0
aiadev/__init__.py ADDED
@@ -0,0 +1,19 @@
1
+ """AI-Augmented Developer CLI package."""
2
+ from __future__ import annotations
3
+
4
+ import pathlib
5
+ from importlib.metadata import PackageNotFoundError, version as _pkg_version
6
+
7
+ # Resolution order:
8
+ # 1. importlib.metadata (works for installed wheels and editable installs).
9
+ # 2. The repo's VERSION file (works for in-repo execution before install).
10
+ try:
11
+ __version__ = _pkg_version("aiadev")
12
+ except PackageNotFoundError:
13
+ _VERSION_FILE = pathlib.Path(__file__).resolve().parents[2] / "VERSION"
14
+ try:
15
+ __version__ = _VERSION_FILE.read_text(encoding="utf-8").strip()
16
+ except FileNotFoundError:
17
+ __version__ = "0.0.0+unknown"
18
+
19
+ __all__ = ["__version__"]
aiadev/__main__.py ADDED
@@ -0,0 +1,5 @@
1
+ """Allow ``python -m aiadev`` in addition to the installed ``aiadev`` script."""
2
+ from .cli import main
3
+
4
+ if __name__ == "__main__": # pragma: no cover
5
+ main()
@@ -0,0 +1,63 @@
1
+ # Agents
2
+
3
+ Agents are subagent definitions invoked by skills. They fall into two
4
+ groups in this repository:
5
+
6
+ - **Framework-native agents** live at the top of this directory. They
7
+ are written for the framework itself and are used by the pipeline
8
+ skills regardless of the active preset.
9
+ - **Preset-specific agents** live under `presets/<preset>/agents/`. They
10
+ assume a particular stack and load only when that preset is active.
11
+
12
+ ## Framework-native agents
13
+
14
+ | Agent | Used by | Purpose |
15
+ |---|---|---|
16
+ | [`spec-document-reviewer`](./spec-document-reviewer.md) | `specify`, `clarify` | Reviews `spec.md` for completeness, clarity, testability. |
17
+ | [`plan-document-reviewer`](./plan-document-reviewer.md) | `plan` | Reviews `plan.md` for TDD compliance, exact file paths, and step granularity. |
18
+ | [`code-reviewer`](./code-reviewer.md) | `implement`, `requesting-code-review` | Reviews code for security, spec alignment, and quality. |
19
+
20
+ These three are the only agents guaranteed to exist on every install.
21
+
22
+ ## The multi-discipline catalog (design / engineering / marketing / …)
23
+
24
+ A popular community catalog of subagents organized by discipline
25
+ (`design/`, `engineering/`, `marketing/`, `studio-operations/`,
26
+ `testing/`, `project-management/`, `product/`) is widely referenced —
27
+ notably at [contains-studio/agents](https://github.com/contains-studio/agents).
28
+
29
+ **We do not bundle that catalog in this repository.** The upstream has
30
+ no visible license at the time of writing, and redistributing unlicensed
31
+ content is not something we do (Article VII — Attribution requires the
32
+ source to be citable, which in turn requires the source to grant
33
+ redistribution rights). If upstream adopts a clear permissive license,
34
+ the catalog can be imported in a future release.
35
+
36
+ In the meantime, projects that want those agents can either:
37
+
38
+ 1. Fork the upstream into their own repository and reference it as an
39
+ external tool.
40
+ 2. Author their own discipline-specific agents under
41
+ `presets/<preset>/agents/<discipline>/`. No preset currently ships
42
+ bundled discipline agents in v0.2.
43
+ 3. Wait for the extensions system (planned for v0.3) to make third-party
44
+ catalogs installable via `aiadev extension install <name>`.
45
+
46
+ ## Stack-specific agents
47
+
48
+ Stack-specific agents live with their preset (`presets/<preset>/agents/`).
49
+ No preset ships discipline-level agents in v0.2; `presets/mobile-ops/`
50
+ only carries operational skills. Preset maintainers are free to add
51
+ agents tailored to their stack, but they should not duplicate the three
52
+ framework-native reviewers listed above.
53
+
54
+ ## Contributing
55
+
56
+ See the project's [CONTRIBUTING.md](../CONTRIBUTING.md). Highlights for
57
+ agent authors:
58
+
59
+ - One agent per file; filename matches the first-line declared name.
60
+ - Keep agents under 150 lines; anything longer usually means the agent
61
+ is trying to be two agents.
62
+ - Document in the frontmatter (or the first paragraph) which skill
63
+ invokes this agent. An agent no skill calls is dead code.
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: code-reviewer
3
+ description: Reviews code for bugs, security issues, code quality, and adherence to spec/project conventions. Returns APPROVED or CHANGES_REQUESTED with actionable feedback.
4
+ tools: Read, Glob, Grep, Bash
5
+ model: sonnet
6
+ ---
7
+
8
+ # Code Reviewer Agent
9
+
10
+ You are a senior code reviewer for a Django 5.2 + React 18 + TypeScript project. Review for correctness, security, maintainability, and spec compliance.
11
+
12
+ ## Your Task
13
+
14
+ Review the diff/files provided and return either APPROVED or CHANGES_REQUESTED with specific, actionable feedback.
15
+
16
+ ## Review Checklist
17
+
18
+ ### 1. Spec Compliance
19
+ - [ ] All acceptance scenarios from the spec are addressed
20
+ - [ ] No behavior outside the spec scope was added
21
+ - [ ] API contracts match what was specified (endpoints, payloads, status codes)
22
+
23
+ ### 2. Security
24
+ - [ ] No SQL injection (raw queries with user input)
25
+ - [ ] No IDOR (user can only access their own data — `get_queryset` scoped to user)
26
+ - [ ] No XSS (user input escaped in templates/responses)
27
+ - [ ] Sensitive data in `EncryptedTextField`, not plain `CharField`/`TextField`
28
+ - [ ] No secrets/tokens hardcoded or logged
29
+ - [ ] API endpoints require authentication (`permission_classes = [IsAuthenticated]`)
30
+
31
+ ### 3. Django/DRF Patterns
32
+ - [ ] No business logic in views (service layer used)
33
+ - [ ] No N+1 queries (`select_related`/`prefetch_related` where needed)
34
+ - [ ] Migrations are reversible (no data loss on rollback)
35
+ - [ ] `transaction.on_commit()` used before Celery task dispatch
36
+ - [ ] `update_fields` specified on `save()` for partial updates
37
+ - [ ] `UserManager` used for user-scoped model querysets
38
+
39
+ ### 4. Celery Tasks
40
+ - [ ] `bind=True` and `max_retries` specified
41
+ - [ ] `time_limit` and `soft_time_limit` set
42
+ - [ ] Task is idempotent (can run twice safely)
43
+ - [ ] Status updated to 'failed' with error message on exception
44
+ - [ ] Exponential backoff on retry
45
+
46
+ ### 5. TypeScript/React
47
+ - [ ] No `any` types (use `unknown` or proper types)
48
+ - [ ] All nullable values handled (`?.` or null checks)
49
+ - [ ] No `useEffect` for data fetching (TanStack Query used)
50
+ - [ ] No `useState` for server data
51
+ - [ ] All async operations have error handling
52
+ - [ ] Component props typed with interface/type
53
+
54
+ ### 6. Test Quality
55
+ - [ ] Tests cover all acceptance scenarios
56
+ - [ ] Tests cover error paths (not just happy path)
57
+ - [ ] No tests that test implementation details (test behavior, not internals)
58
+ - [ ] Mocks are focused (don't mock more than needed)
59
+ - [ ] Test names describe behavior: `test_user_cannot_access_others_data`
60
+
61
+ ### 7. Code Quality
62
+ - [ ] DRY — no duplicated logic (abstract if > 2 repetitions)
63
+ - [ ] Functions have single responsibility
64
+ - [ ] No dead code or commented-out blocks
65
+ - [ ] Log messages include context (object ID, user ID, action)
66
+ - [ ] Error messages are user-actionable
67
+
68
+ ### 8. Performance
69
+ - [ ] No synchronous HTTP calls in request handlers (use Celery)
70
+ - [ ] No unindexed DB queries on large tables
71
+ - [ ] No loading entire querysets when pagination is available
72
+
73
+ ## Output Format
74
+
75
+ ### APPROVED
76
+ ```
77
+ APPROVED
78
+
79
+ Code is correct, secure, and spec-compliant.
80
+ [Optional: 1-3 observations that don't block approval]
81
+ ```
82
+
83
+ ### CHANGES_REQUESTED
84
+ ```
85
+ CHANGES_REQUESTED
86
+
87
+ Blocking (must fix):
88
+ 1. [File:line] — [Issue] — [Specific fix required]
89
+ 2. ...
90
+
91
+ Non-blocking (should address):
92
+ 1. [File:line] — [Issue] — [Suggested improvement]
93
+ 2. ...
94
+ ```
95
+
96
+ ## What NOT to Do
97
+ - Do not request stylistic changes (formatting, naming conventions) unless they indicate a bug
98
+ - Do not request architectural refactors beyond the scope of this PR
99
+ - Do not approve code with security vulnerabilities even as "non-blocking"
100
+ - Do not approve code missing tests for acceptance scenarios
101
+ - Do not add new requirements that weren't in the spec
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: plan-document-reviewer
3
+ description: Reviews plan.md documents for spec alignment, task granularity, and TDD/DRY/YAGNI compliance. Returns APPROVED or CHANGES_REQUESTED.
4
+ tools: Read, Glob, Grep
5
+ model: sonnet
6
+ ---
7
+
8
+ # Plan Document Reviewer Agent
9
+
10
+ You are a plan document reviewer. Your job is to ensure the implementation plan is detailed enough for a developer with no project context to follow, using TDD, DRY, and YAGNI principles.
11
+
12
+ ## Your Task
13
+
14
+ Review the plan chunk provided against the spec document and verify all quality criteria.
15
+
16
+ ## Review Criteria
17
+
18
+ ### 1. Spec Alignment
19
+ - [ ] Every acceptance scenario from the spec has at least one task addressing it
20
+ - [ ] No tasks implement features not in the spec (YAGNI)
21
+ - [ ] Breaking changes are handled with migration/rollback strategy
22
+
23
+ ### 2. Task Granularity
24
+ - [ ] Each task is 2-5 minutes of work (not hours)
25
+ - [ ] Each step is ONE action (write test, run test, implement, run test, commit)
26
+ - [ ] Steps are numbered sequentially with checkboxes `- [ ]`
27
+ - [ ] No "implement the feature" as a single step — must be broken down
28
+
29
+ ### 3. TDD Compliance
30
+ - [ ] Every task that changes behavior has a failing test BEFORE implementation
31
+ - [ ] Test steps include: exact file path, exact test function name, exact run command, expected output
32
+ - [ ] Verify RED step: "Run to confirm it FAILS" — explicitly present
33
+ - [ ] Verify GREEN step: "Run to confirm it PASSES" — explicitly present
34
+
35
+ ### 4. Exact File Paths
36
+ - [ ] Every file mentioned has exact path from repository root
37
+ - [ ] Files to create vs modify clearly distinguished
38
+ - [ ] No vague references like "the service file" — exact path required
39
+
40
+ ### 5. Code Completeness
41
+ - [ ] Code snippets are complete (not "add validation here")
42
+ - [ ] Imports shown where non-obvious
43
+ - [ ] Configuration changes specified exactly
44
+ - [ ] Migration commands included after model changes
45
+
46
+ ### 6. Commit Points
47
+ - [ ] Each task ends with a commit step
48
+ - [ ] Commit message format specified: `feat(<app>): description` or `fix(<app>): description`
49
+ - [ ] Files to stage explicitly listed
50
+
51
+ ### 7. Stack Conventions
52
+ For Django backend:
53
+ - [ ] Model → Serializer → Service → View → URL order followed
54
+ - [ ] `transaction.on_commit()` used for Celery task dispatch
55
+ - [ ] UserManager used for user-scoped models
56
+ - [ ] `EncryptedTextField` for sensitive data
57
+
58
+ For React frontend:
59
+ - [ ] TypeScript types defined before components
60
+ - [ ] TanStack Query hooks before components
61
+ - [ ] No `useState` for server data
62
+
63
+ ### 8. Verifiability
64
+ - [ ] Each task has explicit verification step
65
+ - [ ] Test commands are copy-pasteable (no placeholders)
66
+ - [ ] Expected output described for each verification
67
+
68
+ ## Output Format
69
+
70
+ ### APPROVED
71
+ ```
72
+ APPROVED
73
+
74
+ Plan chunk is complete, TDD-compliant, and ready for execution.
75
+ [Optional brief notes]
76
+ ```
77
+
78
+ ### ISSUES_FOUND
79
+ ```
80
+ ISSUES_FOUND
81
+
82
+ Blocking:
83
+ 1. Task N: [Issue] — [What's missing] — [What to add]
84
+
85
+ Non-blocking:
86
+ 1. Task N: [Minor issue] — [Suggested improvement]
87
+ ```
88
+
89
+ ## What NOT to Do
90
+ - Do not approve if any task lacks a failing test before implementation
91
+ - Do not approve if file paths are vague or missing
92
+ - Do not add implementation details beyond what's needed for the plan
93
+ - Do not request style changes to working code examples
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: spec-document-reviewer
3
+ description: Reviews spec.md documents for completeness, clarity, and testability before any code-writing begins. Returns APPROVED or CHANGES_REQUESTED with specific edits.
4
+ tools: Read, Glob, Grep
5
+ model: sonnet
6
+ ---
7
+
8
+ # Spec Document Reviewer Agent
9
+
10
+ You are a spec document reviewer. Your job is to ensure the specification is complete, unambiguous, and implementable before any code is written.
11
+
12
+ ## Your Task
13
+
14
+ Review the spec document provided and verify it meets all quality criteria below.
15
+
16
+ ## Review Criteria
17
+
18
+ ### 1. Completeness
19
+ - [ ] Feature is clearly named and scoped
20
+ - [ ] At least 3 user stories with concrete acceptance scenarios (Given/When/Then)
21
+ - [ ] Each acceptance scenario is independently testable
22
+ - [ ] Priority assigned to each user story (P1/P2/P3)
23
+ - [ ] Technical context specified (stack, dependencies, storage)
24
+
25
+ ### 2. Clarity
26
+ - [ ] No ambiguous requirements ("should", "maybe", "could" — replace with "must" or "will")
27
+ - [ ] No undefined acronyms or jargon without explanation
28
+ - [ ] Each user story describes one behavior (not multiple)
29
+ - [ ] Success criteria are measurable (not "fast" but "< 500ms response time")
30
+
31
+ ### 3. Implementability
32
+ - [ ] Technical approach is feasible with the current stack
33
+ - [ ] No requirements that contradict existing architecture
34
+ - [ ] Security considerations noted (authentication, data privacy)
35
+ - [ ] Breaking changes explicitly flagged
36
+ - [ ] Dependencies on other features/systems identified
37
+
38
+ ### 4. Testability
39
+ - [ ] Every acceptance scenario can be verified by a test
40
+ - [ ] Edge cases covered (empty state, error state, concurrent access)
41
+ - [ ] Performance criteria specified where relevant
42
+
43
+ ### 5. Scope
44
+ - [ ] Feature is appropriately sized for one development branch
45
+ - [ ] If too large: flagged for decomposition into sub-features
46
+ - [ ] YAGNI applied: no speculative/future requirements included
47
+
48
+ ## Output Format
49
+
50
+ Return ONE of:
51
+
52
+ ### APPROVED
53
+ ```
54
+ APPROVED
55
+
56
+ The spec is complete, clear, and implementable. Ready for plan writing.
57
+
58
+ [Optional: 1-2 sentences noting any minor observations that don't block approval]
59
+ ```
60
+
61
+ ### ISSUES_FOUND
62
+ ```
63
+ ISSUES_FOUND
64
+
65
+ Critical (must fix before proceeding):
66
+ 1. [Issue] — [Why it blocks implementation] — [Suggested fix]
67
+ 2. ...
68
+
69
+ Minor (should address):
70
+ 1. [Issue] — [Why it matters] — [Suggested fix]
71
+ 2. ...
72
+ ```
73
+
74
+ ## What NOT to Do
75
+ - Do not approve a spec that has undefined acceptance criteria
76
+ - Do not request changes for style preferences only
77
+ - Do not add new requirements — only verify existing ones are clear
78
+ - Do not comment on implementation details unless they reveal a spec gap
@@ -0,0 +1,145 @@
1
+ # Constitution
2
+
3
+ This document governs how the AI-Augmented Developer framework is built and how projects using it should expect it to behave. It is also the default constitution copied into new projects via `aiadev init` — projects can then edit, add, or waive articles for their own context.
4
+
5
+ Changes to this file follow the process in `CONTRIBUTING.md`. Amendments require an issue, an RFC-style PR, and at least one reviewer who is not the author.
6
+
7
+ **Version:** 1.0.0 — cf. [CHANGELOG.md](./CHANGELOG.md).
8
+
9
+ ---
10
+
11
+ ## Article I — Spec-first
12
+
13
+ **Statement.** No code is written without an approved `spec.md`. Specifications describe **what** and **why**; plans and code describe **how**.
14
+
15
+ **Rationale.** Every recurring failure mode we want to eliminate — wasted implementation work, hidden ambiguity surfacing as bugs, disagreement between humans and agents about what "done" means — starts with code that ran ahead of a spec. The cost of writing a spec is always smaller than the cost of discovering the wrong thing was built.
16
+
17
+ **Test.** For any branch producing code that affects behavior:
18
+
19
+ - [ ] `specs/<branch>/spec.md` exists.
20
+ - [ ] It contains zero `[NEEDS CLARIFICATION]` markers.
21
+ - [ ] Every `spec.md` acceptance scenario maps to at least one task in `tasks.md`.
22
+
23
+ **Waivable?** Yes, for:
24
+
25
+ - Typo fixes, formatting, comment edits, documentation-only changes.
26
+ - Reverts of previously-merged changes (the revert's motivation goes in the commit message).
27
+ - Emergency fixes explicitly labelled `hotfix:` in the commit prefix; a retrospective `spec.md` must be filed within 72 hours.
28
+
29
+ ---
30
+
31
+ ## Article II — Test-first
32
+
33
+ **Statement.** For any change that alters behavior, a failing test is written before the implementation. The test must fail for the right reason before production code is added.
34
+
35
+ **Rationale.** Tests written after implementation are the same code twice — they reproduce bugs the implementation already shipped with. A test that has never been red never proves anything.
36
+
37
+ **Test.** For each task in `tasks.md`:
38
+
39
+ - [ ] The commit introducing the test is earlier (in history) than the commit that makes it pass.
40
+ - [ ] The test was observed failing on the task author's machine before the implementation commit.
41
+ - [ ] The test exercises an acceptance scenario in `spec.md`.
42
+
43
+ **Waivable?** Yes, for:
44
+
45
+ - Research spikes explicitly marked `@spike` in the branch name and deleted before merge.
46
+ - Exploratory prototypes in `experiments/` that never ship to users.
47
+ - Generated code (migrations, codegen output) where the generator itself is tested.
48
+
49
+ Waivers must be documented in the PR body under `Complexity Tracking`.
50
+
51
+ ---
52
+
53
+ ## Article III — Simplicity (YAGNI)
54
+
55
+ **Statement.** Build only what the current spec requires. No speculative generalization, no abstraction for hypothetical future callers, no options nobody asked for.
56
+
57
+ **Rationale.** Every abstraction has a maintenance cost paid by every future reader. Three similar inline blocks are cheaper than a wrong abstraction. Premature indirection is the most common form of accidental complexity in this codebase.
58
+
59
+ **Test.** For each plan or PR:
60
+
61
+ - [ ] No new class, interface, protocol, or indirection layer without a second caller that needs it **today**.
62
+ - [ ] No new configuration flag without a named user of the non-default value.
63
+ - [ ] No new dependency without a rejected alternative documented.
64
+
65
+ **Waivable?** Yes, when another article forces the abstraction (e.g. Article V requires a provider interface around an external service even if there is only one provider today). The waiver cites the forcing article.
66
+
67
+ ---
68
+
69
+ ## Article IV — Evidence over claims
70
+
71
+ **Statement.** "Done" means verified. A claim that tests pass, a build works, or a feature behaves correctly is backed by a transcript, log, or command the reader can re-run — not by the author's memory.
72
+
73
+ **Rationale.** Agent-written code amplifies the cost of unverified claims: a confident "all green" that was never observed cascades into users hitting broken flows. The fix is cheap — show the evidence.
74
+
75
+ **Test.** For each PR:
76
+
77
+ - [ ] The test plan in the PR body lists the exact commands run (not "ran the tests").
78
+ - [ ] At least one command's output (pass/fail summary) is pasted or linked.
79
+ - [ ] For UI changes, a screenshot or recording is attached.
80
+ - [ ] Any "worked locally" claim names the OS, language version, and relevant environment.
81
+
82
+ **Waivable?** No. Evidence is non-negotiable, because the alternative is trust without verification.
83
+
84
+ ---
85
+
86
+ ## Article V — Provider pattern for external systems
87
+
88
+ **Statement.** Any external dependency with a network boundary (LLM API, database, object storage, email, push notifications, payment, feature flag service) is accessed through a provider interface defined inside the project, not through the vendor SDK directly.
89
+
90
+ **Rationale.** Vendor lock-in is not the only reason. Provider interfaces give us a single chokepoint for: authentication, retry policy, telemetry, test doubles, and the eventual switch when the vendor raises prices or changes terms.
91
+
92
+ **Test.** For each plan that introduces or modifies an external integration:
93
+
94
+ - [ ] A provider interface lives in the project (`<app>/providers/<name>.py` or equivalent).
95
+ - [ ] The vendor SDK is imported only inside the provider implementation.
96
+ - [ ] Tests use a fake provider, not a mocked SDK.
97
+
98
+ **Waivable?** Yes, for one-off scripts under `scripts/` that never run in production. Not waivable for anything invoked by user-facing code.
99
+
100
+ ---
101
+
102
+ ## Article VI — Privacy by design
103
+
104
+ **Statement.** Sensitive data is encrypted at rest, never logged in plaintext, and segregated per user at every layer from storage to API response.
105
+
106
+ **Rationale.** The baseline question is not "did we intend to leak this?" but "can this possibly leak?". Encrypting-by-default, never-log-by-default, and isolate-by-default eliminate whole classes of incident before they happen.
107
+
108
+ **Test.** For each PR:
109
+
110
+ - [ ] No new log line contains credentials, tokens, PII, or message bodies (verified by grep in CI).
111
+ - [ ] Any new model field containing secrets uses the project's encrypted field type (e.g. `EncryptedTextField`).
112
+ - [ ] Any new queryset that returns data from multiple users is gated by an explicit permission check.
113
+
114
+ **Waivable?** No for production code paths. Yes for test fixtures with clearly fake data (`user@example.com`).
115
+
116
+ ---
117
+
118
+ ## Article VII — Attribution
119
+
120
+ **Statement.** When material (skills, templates, agent definitions, prompts) is adapted from another project, the source is named in `CREDITS.md` with a link and license notice. Forks without attribution erode the ecosystem we depend on.
121
+
122
+ **Rationale.** This project itself began as an adaptation of other open-source work (`obra/superpowers`, later `github/spec-kit`, the `contains-studio/agents` catalog). The integrity of that lineage is part of the product.
123
+
124
+ **Test.** For each PR that adds content derived from another project:
125
+
126
+ - [ ] `CREDITS.md` has an entry with the source repo, the specific material, and the license.
127
+ - [ ] If the source license requires it, the original notice is preserved alongside the adapted file.
128
+
129
+ **Waivable?** No.
130
+
131
+ ---
132
+
133
+ ## Relationship to other artifacts
134
+
135
+ - **Presets** may **add** articles for their stack (e.g. `presets/django-drf-react/constitution.md` can require API-first, async-first, and Docker-native patterns). They may not **remove** articles from this root constitution.
136
+ - **Extensions** may not add constitutional articles. Extensions are additive behavior only; governance changes go through this file.
137
+ - **`CLAUDE.md`** and its platform siblings quote this constitution in their preamble so the agent has it in context from turn one.
138
+ - Every `plan.md` ships with a **Constitution Check** section that ticks each applicable article or justifies a waiver in its **Complexity Tracking** table.
139
+
140
+ ## Amendment process
141
+
142
+ 1. Open an issue proposing the amendment. State the article affected, the incident or evidence motivating the change, and the blast radius (which existing plans would fail a retroactive check).
143
+ 2. Submit a PR that edits this file and bumps the version at the top. One article per PR.
144
+ 3. At least one non-author reviewer approves. Breaking changes (article removal or narrowing of a waiver) require two reviewers and 48 hours of public comment.
145
+ 4. On merge, append a `Changed` entry to `CHANGELOG.md [Unreleased]` noting the version bump.
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "./catalog.schema.json",
3
+ "version": "1",
4
+ "presets": [
5
+ {
6
+ "name": "lean",
7
+ "path": "presets/lean",
8
+ "summary": "Framework-only preset: pipeline skills + constitution, no stack opinions.",
9
+ "use_when": "Stack is exotic or you want the pipeline without built-in stack skills.",
10
+ "maintained_by": "ai-augmented-developer core",
11
+ "stability": "stable"
12
+ },
13
+ {
14
+ "name": "django-drf-react",
15
+ "path": "presets/django-drf-react",
16
+ "summary": "Django 5.2 + DRF + React 18 + TypeScript + Celery + Cloud Run.",
17
+ "use_when": "Full-stack web app with Python backend and React frontend.",
18
+ "maintained_by": "ai-augmented-developer core",
19
+ "stability": "stable"
20
+ },
21
+ {
22
+ "name": "mobile-ops",
23
+ "path": "presets/mobile-ops",
24
+ "summary": "Operational runbooks (build/submit/deploy/OTA/release-notes) for Cloud Run backend + Expo mobile via EAS + React admin.",
25
+ "use_when": "Project ships a Cloud Run backend alongside an Expo mobile app on EAS and optionally a React admin app.",
26
+ "maintained_by": "ai-augmented-developer core",
27
+ "stability": "beta"
28
+ }
29
+ ]
30
+ }
@@ -0,0 +1,123 @@
1
+ # {{PROJECT_NAME}} — Django + DRF + React preset
2
+
3
+ > Generated from the `django-drf-react` preset of the AI-Augmented Developer
4
+ > framework. Regenerate with `aiadev install --preset django-drf-react` if
5
+ > the preset changes.
6
+
7
+ You are working inside a full-stack project using the Django + DRF + React
8
+ stack. Follow the pipeline described below. The framework-level
9
+ constitution at `constitution.md` applies unchanged; the preset adds the
10
+ articles in `presets/django-drf-react/constitution.md`.
11
+
12
+ ## Pipeline (from framework)
13
+
14
+ `specify → clarify → plan → tasks → implement`
15
+
16
+ See the root [CLAUDE.md](../../CLAUDE.md) for the canonical skill table.
17
+ This file only carries the stack additions.
18
+
19
+ ## Tech stack
20
+
21
+ **Backend**
22
+
23
+ - Python 3.12 + Django 5.2 + Django REST Framework
24
+ - Celery 5 + Redis (async task queue)
25
+ - PostgreSQL 16
26
+ - LiteLLM (Gemini 2.5 Pro/Flash, Groq Llama, Anthropic Claude)
27
+ - Claude Agent SDK (`claude_agent_sdk`) for autonomous code execution
28
+
29
+ **Frontend**
30
+
31
+ - React 18 + TypeScript 5 (strict mode)
32
+ - Material UI v5
33
+ - TanStack Query v5 (server state)
34
+ - Framer Motion (animations)
35
+ - Vite
36
+
37
+ **Mobile**
38
+
39
+ - React Native + Expo
40
+ - EAS Build (cloud iOS, local Android)
41
+ - EAS Update (OTA for JS-only changes)
42
+
43
+ **Infrastructure**
44
+
45
+ - Docker + Docker Compose
46
+ - Nginx (reverse proxy, SSE support)
47
+ - GCP Cloud Run
48
+
49
+ ## Project layout
50
+
51
+ ```text
52
+ {{BACKEND_DIR}}/
53
+ ├── config/ # Django settings, URLs, Celery config
54
+ ├── accounts/ # User authentication and profiles
55
+ ├── ai/ # AI service (LiteLLM), prompts, usage tracking
56
+ ├── <other apps>/ # Project-specific apps
57
+ └── shared/ # Shared utilities, managers, base models
58
+
59
+ {{FRONTEND_DIR}}/src/
60
+ ├── pages/ # Route-level page components
61
+ ├── components/ # Reusable UI components
62
+ ├── hooks/ # TanStack Query hooks
63
+ ├── types/ # TypeScript interfaces
64
+ ├── utils/ # API client, helpers
65
+ └── contexts/ # React contexts
66
+
67
+ specs/ # Feature specs and implementation plans
68
+ ```
69
+
70
+ ## Preset-specific skills
71
+
72
+ Loaded from `presets/django-drf-react/skills/`:
73
+
74
+ - `django-patterns` — App / model / serializer / view / URL conventions.
75
+ - `ai-integration` — LiteLLM + Claude Agent SDK providers.
76
+ - `celery-async` — Task patterns, scheduling, retries, idempotency.
77
+ - `autodev-pipeline` — The proactive auto-development pipeline.
78
+ - `deploy` — Cloud Run + EAS deployment runbooks.
79
+ - `run-tests` — pytest backend + Jest frontend entry point.
80
+
81
+ ## Quick commands
82
+
83
+ ```bash
84
+ # Backend tests
85
+ cd {{BACKEND_DIR}} && pytest --tb=short
86
+
87
+ # Frontend tests
88
+ cd {{FRONTEND_DIR}} && npx jest --no-coverage
89
+
90
+ # TypeScript check
91
+ cd {{FRONTEND_DIR}} && npx tsc --noEmit
92
+
93
+ # Linting
94
+ cd {{BACKEND_DIR}} && ruff check .
95
+ cd {{FRONTEND_DIR}} && npm run lint
96
+
97
+ # Start dev (backend)
98
+ cd {{BACKEND_DIR}} && source venv/bin/activate
99
+ watchfiles 'daphne -b 0.0.0.0 -p 8000 config.asgi:application' .
100
+
101
+ # Start dev (frontend)
102
+ cd {{FRONTEND_DIR}} && npm run dev
103
+
104
+ # Celery worker
105
+ celery -A config worker -l info
106
+
107
+ # Celery beat (scheduled tasks)
108
+ celery -A config beat -l info
109
+ ```
110
+
111
+ ## Waivers carried by this preset
112
+
113
+ - **Article III (Simplicity)** — when introducing the provider interface for
114
+ a new AI model vendor, the second caller rule is relaxed: the interface
115
+ is required by Article V and Article III must yield to it. Document the
116
+ waiver in the plan's Complexity Tracking.
117
+
118
+ <!-- aiadev:auto-stack:start -->
119
+ ## Detected stack
120
+
121
+ _Run `aiadev sync` to populate this block from the project's
122
+ package.json / pyproject.toml / Makefile / docker-compose / workflows._
123
+ <!-- aiadev:auto-stack:end -->