Loading...
Loading...
Creates, updates, validates, and displays the architectural DNA of a project through two shared documents: docs/specs/architecture.md (technology stack, architectural rules, security constraints, AI guardrails) and docs/specs/ontology.md (domain glossary / Ubiquitous Language). Use BEFORE brainstorm as a project setup step, or at any point in the SDD lifecycle to validate specs/tasks against architecture principles. Triggers on 'create constitution', 'update constitution', 'constitution check', 'validate against constitution', 'project principles', 'architectural guardrails', 'setup project architecture', 'define ontology'.
npx skill4agent add giuseppe-trisciuoglio/developer-kit constitution$ARGUMENTScreateupdatecheckshowAskUserQuestionLast Updated/developer-kit-specs:constitution create/developer-kit-specs:constitution check --target=docs/specs/001/2024-01-15--user-auth.md/developer-kit-specs:constitution update --file=architecture --section=security/developer-kit-specs:constitution show| File | Purpose |
|---|---|
| Technology stack, infrastructure choices, architectural rules, security constraints, AI guardrails |
| Domain glossary (Ubiquitous Language) — terms, definitions, bounded contexts |
docs/specs/brainstormspec-to-tasks| Scenario | Operation |
|---|---|
| New project — define stack and domain language before first brainstorm | |
| Stack or security rules changed | |
| Validate a spec, task, or file against architecture and ontology | |
| Review current architecture and ontology | |
$ARGUMENTSdocs/specs/architecture.mdAskUserQuestiondocs/specs/architecture.mddocs/specs/ontology.mdAskUserQuestion"The ontology captures the Ubiquitous Language of your project. It is normally enriched during brainstorming when terms emerge from the idea. You can seed it now with known terms, or create an empty scaffold to fill later."
docs/specs/ontology.md$ARGUMENTS--file=architecture--file=ontology--section=<section-name>--section=security--section=glossaryLast Updateddocs/specs/architecture.mddocs/specs/ontology.md$ARGUMENTS--target=<path>docs/specs/architecture.mddocs/specs/ontology.md# Project Architecture
**Created**: YYYY-MM-DD
**Last Updated**: YYYY-MM-DD
## Software Stack
| Component | Technology | Notes |
|-----------|-----------|-------|
| Language | [e.g., TypeScript] | [version if known] |
| Framework | [e.g., NestJS] | [version if known] |
| Key Libraries | [e.g., Drizzle ORM, Passport] | |
## Data Architecture
| Component | Technology | Notes |
|-----------|-----------|-------|
| Primary Database | [e.g., PostgreSQL] | |
| Caching | [e.g., Redis, none] | |
| ORM / Data Access | [e.g., Drizzle, Hibernate] | |
| Migrations | [e.g., Flyway, Drizzle Kit] | |
## Infrastructure
| Component | Technology | Notes |
|-----------|-----------|-------|
| Hosting | [e.g., AWS ECS] | |
| CI/CD | [e.g., GitHub Actions] | |
| Containerization | [e.g., Docker] | |
| Orchestration | [e.g., Kubernetes, none] | |
## Architectural Rules
- [Rule 1, e.g., "Use constructor injection. Never use @Autowired on fields."]
- [Rule 2, e.g., "Domain entities must not depend on framework annotations."]
## Security Constraints
- Forbidden patterns:
- No raw SQL string concatenation (SQL injection — CWE-89)
- No hardcoded secrets or credentials (CWE-798)
- No deserialization of untrusted data (CWE-502)
- Required patterns:
- [e.g., All inputs validated with Bean Validation]
- [e.g., All secrets via environment variables or Secrets Manager]
## AI Guardrails
Rules that AI agents MUST follow when generating code for this project:
- [Guardrail 1, e.g., "Never generate @Transactional on repository methods."]
- [Guardrail 2, e.g., "Always generate tests alongside implementation code."]
- [Guardrail 3, e.g., "Do not introduce new dependencies without explicit approval."]
## Architecture Decisions
> Significant modifications to this architecture document must be tracked
> via **ADR (Architecture Decision Records)** using the `adr-drafting` skill.
>
> ADR location: `docs/architecture/adr/`# Project Ontology — Ubiquitous Language
**Created**: YYYY-MM-DD
**Last Updated**: YYYY-MM-DD
## Domain Glossary
| Term | Definition | Bounded Context |
|------|-----------|-----------------|
| [Term 1] | [Definition] | [Context where this term applies] |
| [Term 2] | [Definition] | [Context where this term applies] |
## Bounded Contexts
| Context | Description | Key Terms |
|---------|-------------|-----------|
| [Context 1] | [Description] | [Key terms] |
## Conceptual Mapping
[Relationships between key domain entities — to be refined during brainstorming and task generation]## Constitution Check Report
Target: <file or spec path>
Date: YYYY-MM-DD
### Architecture Check
| Rule | Status | Detail |
|------|--------|--------|
| Constructor injection required | ✅ OK | No field injection found |
| No hardcoded secrets | ❌ CRITICAL | Line 42: hardcoded password string |
| JWT authentication | ⚠️ WARNING | Missing @PreAuthorize on endpoint |
### Ontology Check
| Term | Status | Detail |
|------|--------|--------|
| "Reservation" used consistently | ✅ OK | No synonym "Booking" found |
| New term "Voucher" introduced | ⚠️ WARNING | Not defined in ontology.md |
### Summary
- CRITICAL violations: 1 (must fix before proceeding)
- WARNING violations: 2 (should fix)
- Compliant rules: 2| Command | When | What it does |
|---|---|---|
| Before brainstorm (this skill) | Creates architecture.md and/or ontology.md from scratch |
| During brainstorming | Creates/enriches ontology.md with terms extracted from the idea |
| After brainstorm | Creates architecture.md if missing; enriches ontology.md with new terms from the spec |
constitution createconstitution create[Optional] constitution create ← this skill (pre-brainstorm setup)
↓
brainstorm ← enriches ontology.md (Phase 6.8.6)
↓
spec-to-tasks ← loads/creates architecture.md, enriches ontology.md (Phase 1.5)
↓
task-implementation ← AI guardrails from architecture.md prevent unapproved patterns
↓
task-review / ralph-loop ← constitution check validates implementationdocs/specs/architecture.mddocs/specs/ontology.mdLast Updated