@activatus/code-standards 0.0.0-stage → 2.0.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/README.md +200 -2
- package/docs/Guides/_category_.json +4 -0
- package/docs/Guides/component-library-workflow.md +182 -0
- package/docs/Guides/migrating.md +144 -0
- package/docs/Guides/setup.md +130 -0
- package/docs/Standards/_category_.json +4 -0
- package/docs/Standards/agent-skills.md +125 -0
- package/docs/Standards/agent-specs.md +89 -0
- package/docs/Standards/branch-naming.md +66 -0
- package/docs/Standards/conventional-commits.md +189 -0
- package/docs/Standards/direnv.mdx +249 -0
- package/docs/Standards/documentation.md +311 -0
- package/docs/Standards/editorconfig.md +72 -0
- package/docs/Standards/eslint.md +709 -0
- package/docs/Standards/human-readable-names.md +234 -0
- package/docs/Standards/lint-errors.md +139 -0
- package/docs/Standards/prettier.md +97 -0
- package/docs/Standards/readable-code.md +540 -0
- package/docs/Standards/stylelint.md +178 -0
- package/docs/Standards/styling.md +284 -0
- package/docs/Standards/tech-stack.md +156 -0
- package/docs/Structure/_category_.json +4 -0
- package/docs/Structure/api-routes.md +118 -0
- package/docs/Structure/component-organization.md +519 -0
- package/docs/Structure/folder-structure.md +353 -0
- package/docs/Structure/import-organization.md +158 -0
- package/docs/Structure/naming-conventions.md +336 -0
- package/docs/design-system-components.md +117 -0
- package/docs/intro.md +46 -0
- package/docs/ontology.md +132 -0
- package/docs/templates.mdx +419 -0
- package/docs/version-history.md +211 -0
- package/package.json +56 -3
- package/static/templates/.commitlintrc.json +3 -0
- package/static/templates/.editorconfig +28 -0
- package/static/templates/.envrc +25 -0
- package/static/templates/.nvmrc +1 -0
- package/static/templates/AGENTS.md +160 -0
- package/static/templates/decision-doc.md +19 -0
- package/static/templates/docs/ai/agent-harness.md +17 -0
- package/static/templates/docs/ai/agents.md +17 -0
- package/static/templates/docs/ai/architecture.md +17 -0
- package/static/templates/docs/ai/context.md +17 -0
- package/static/templates/docs/ai/model-routing.md +17 -0
- package/static/templates/docs/ai/models.md +17 -0
- package/static/templates/docs/ai/retrieval.md +17 -0
- package/static/templates/docs/ai/tools.md +17 -0
- package/static/templates/docs/architecture/authentication.md +17 -0
- package/static/templates/docs/architecture/backend.md +17 -0
- package/static/templates/docs/architecture/background-jobs.md +17 -0
- package/static/templates/docs/architecture/backups.md +17 -0
- package/static/templates/docs/architecture/caching.md +17 -0
- package/static/templates/docs/architecture/ci-cd.md +17 -0
- package/static/templates/docs/architecture/disaster-recovery.md +17 -0
- package/static/templates/docs/architecture/environments.md +17 -0
- package/static/templates/docs/architecture/frontend.md +17 -0
- package/static/templates/docs/architecture/hosting.md +17 -0
- package/static/templates/docs/architecture/observability.md +17 -0
- package/static/templates/docs/architecture/realtime.md +17 -0
- package/static/templates/docs/architecture/search.md +17 -0
- package/static/templates/docs/architecture/services.md +17 -0
- package/static/templates/docs/architecture/state-management.md +17 -0
- package/static/templates/docs/architecture/storage.md +17 -0
- package/static/templates/docs/architecture/system.md +17 -0
- package/static/templates/docs/business/buying-trigger.md +17 -0
- package/static/templates/docs/business/customer-value.md +17 -0
- package/static/templates/docs/business/customer.md +17 -0
- package/static/templates/docs/business/defensibility.md +17 -0
- package/static/templates/docs/business/growth.md +17 -0
- package/static/templates/docs/business/pricing.md +17 -0
- package/static/templates/docs/business/revenue-model.md +17 -0
- package/static/templates/docs/business/unit-economics.md +17 -0
- package/static/templates/docs/data/analytics.md +17 -0
- package/static/templates/docs/data/audit.md +17 -0
- package/static/templates/docs/data/database.md +17 -0
- package/static/templates/docs/data/indexing.md +17 -0
- package/static/templates/docs/data/migrations.md +17 -0
- package/static/templates/docs/data/model.md +17 -0
- package/static/templates/docs/data/retention.md +17 -0
- package/static/templates/docs/data/schema.md +17 -0
- package/static/templates/docs/deployment/approval.md +17 -0
- package/static/templates/docs/deployment/live-verification.md +17 -0
- package/static/templates/docs/deployment/process.md +17 -0
- package/static/templates/docs/deployment/rollback.md +17 -0
- package/static/templates/docs/design/design-system.md +17 -0
- package/static/templates/docs/design/errors.md +17 -0
- package/static/templates/docs/design/feedback.md +17 -0
- package/static/templates/docs/design/interactions.md +17 -0
- package/static/templates/docs/design/layout.md +17 -0
- package/static/templates/docs/design/navigation.md +17 -0
- package/static/templates/docs/design/principles.md +17 -0
- package/static/templates/docs/design/responsive.md +17 -0
- package/static/templates/docs/development/branching.md +17 -0
- package/static/templates/docs/development/code-quality.md +17 -0
- package/static/templates/docs/development/coding-standards.md +17 -0
- package/static/templates/docs/development/commits.md +17 -0
- package/static/templates/docs/development/merge-strategy.md +17 -0
- package/static/templates/docs/development/process.md +17 -0
- package/static/templates/docs/development/pull-requests.md +17 -0
- package/static/templates/docs/experience/accessibility.md +17 -0
- package/static/templates/docs/experience/aha-moment.md +17 -0
- package/static/templates/docs/experience/anti-experience.md +17 -0
- package/static/templates/docs/experience/friction.md +17 -0
- package/static/templates/docs/experience/outcomes.md +17 -0
- package/static/templates/docs/experience/principles.md +17 -0
- package/static/templates/docs/experience/retention.md +17 -0
- package/static/templates/docs/experience/sharing.md +17 -0
- package/static/templates/docs/overview/how-it-works.md +17 -0
- package/static/templates/docs/overview/what-is-it.md +17 -0
- package/static/templates/docs/overview/writing-docs.md +16 -0
- package/static/templates/docs/pitch/alternatives.md +17 -0
- package/static/templates/docs/pitch/assumptions.md +17 -0
- package/static/templates/docs/pitch/audience.md +17 -0
- package/static/templates/docs/pitch/concept.md +17 -0
- package/static/templates/docs/pitch/differentiators.md +17 -0
- package/static/templates/docs/pitch/outcomes.md +17 -0
- package/static/templates/docs/pitch/problem.md +17 -0
- package/static/templates/docs/pitch/product-market-fit.md +17 -0
- package/static/templates/docs/pitch/success-criteria.md +17 -0
- package/static/templates/docs/pitch/validation.md +17 -0
- package/static/templates/docs/pitch/value-proposition.md +17 -0
- package/static/templates/docs/pitch/vision.md +17 -0
- package/static/templates/docs/scope/core.md +17 -0
- package/static/templates/docs/scope/exclusions.md +17 -0
- package/static/templates/docs/scope/future.md +17 -0
- package/static/templates/docs/scope/launch.md +17 -0
- package/static/templates/docs/scope/post-launch.md +17 -0
- package/static/templates/docs/scope/priorities.md +17 -0
- package/static/templates/docs/scope/quality-bar.md +17 -0
- package/static/templates/docs/security/audit.md +17 -0
- package/static/templates/docs/security/data-access.md +17 -0
- package/static/templates/docs/security/logging.md +17 -0
- package/static/templates/docs/security/privacy.md +17 -0
- package/static/templates/docs/security/secrets.md +17 -0
- package/static/templates/docs/security/threat-model.md +17 -0
- package/static/templates/docs/testing/end-to-end.md +17 -0
- package/static/templates/docs/testing/integration.md +17 -0
- package/static/templates/docs/testing/regression.md +17 -0
- package/static/templates/docs/testing/security.md +17 -0
- package/static/templates/docs/testing/strategy.md +17 -0
- package/static/templates/docs/testing/test-data.md +17 -0
- package/static/templates/docs/testing/unit.md +17 -0
- package/static/templates/docs/uat/checks.md +17 -0
- package/static/templates/docs/uat/strategy.md +17 -0
- package/static/templates/docs/users/permissions.md +17 -0
- package/static/templates/docs/users/roles.md +17 -0
- package/static/templates/docs/users/user-types.md +17 -0
- package/static/templates/docs/workflows/assignment.md +17 -0
- package/static/templates/docs/workflows/bugfix.md +17 -0
- package/static/templates/docs/workflows/dependencies.md +17 -0
- package/static/templates/docs/workflows/deployment.md +17 -0
- package/static/templates/docs/workflows/development.md +17 -0
- package/static/templates/docs/workflows/planning.md +17 -0
- package/static/templates/docs/workflows/review.md +17 -0
- package/static/templates/docs/workflows/uat.md +17 -0
- package/static/templates/docsSite/docusaurus.config.ts +119 -0
- package/static/templates/docsSite/gitignore.txt +3 -0
- package/static/templates/docsSite/package.json.txt +42 -0
- package/static/templates/docsSite/pnpm-workspace.yaml +2 -0
- package/static/templates/docsSite/sidebars.ts +8 -0
- package/static/templates/docsSite/src/css/custom.css +1 -0
- package/static/templates/docsSite/src/pages/index.tsx +9 -0
- package/static/templates/docsSite/static/images/logo.svg +4 -0
- package/static/templates/docsSite/tsconfig.json +7 -0
- package/static/templates/eslint/base/eslint.config.mjs +79 -0
- package/static/templates/eslint/nextjs/eslint.config.mjs +137 -0
- package/static/templates/eslint/react/eslint.config.mjs +138 -0
- package/static/templates/eslint/typescript/eslint.config.mjs +126 -0
- package/static/templates/globals.css +16 -0
- package/static/templates/husky/commit-msg +1 -0
- package/static/templates/husky/pre-commit +1 -0
- package/static/templates/next.config.mjs +18 -0
- package/static/templates/prettier.config.js +17 -0
- package/static/templates/skills/codeReview.md +31 -0
- package/static/templates/skills/format.md +18 -0
- package/static/templates/skills/lint.md +21 -0
- package/static/templates/skills/lintFix.md +24 -0
- package/static/templates/skills/securityAudit.md +28 -0
- package/static/templates/skills/test.md +24 -0
- package/static/templates/skills/typescript.md +28 -0
- package/static/templates/skills/updateLayout.md +20 -0
- package/static/templates/stylelint/css/stylelint.config.mjs +28 -0
- package/static/templates/stylelint/scss/stylelint.config.mjs +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activatus/code-standards",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "The Activatus code standards: the rules as Markdown, and the config files to copy. Install it so an AI agent can read the standards from node_modules.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/activatus-life/code-standards.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://activatus-code-standards.vercel.app",
|
|
10
|
+
"files": [
|
|
11
|
+
"docs",
|
|
12
|
+
"static/templates",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@docusaurus/core": "3.10.2",
|
|
20
|
+
"@docusaurus/module-type-aliases": "3.10.2",
|
|
21
|
+
"@docusaurus/preset-classic": "3.10.2",
|
|
22
|
+
"@docusaurus/theme-mermaid": "3.10.2",
|
|
23
|
+
"@docusaurus/tsconfig": "3.10.2",
|
|
24
|
+
"@docusaurus/types": "3.10.2",
|
|
25
|
+
"@getcanary/docusaurus-theme-search-pagefind": "1.0.2",
|
|
26
|
+
"@getcanary/web": "^1.0.0",
|
|
27
|
+
"@mdx-js/react": "^3.0.0",
|
|
28
|
+
"clsx": "^2.0.0",
|
|
29
|
+
"pagefind": "^1.3.0",
|
|
30
|
+
"prism-react-renderer": "^2.3.0",
|
|
31
|
+
"raw-loader": "^4.0.2",
|
|
32
|
+
"react": "^18.3.1",
|
|
33
|
+
"react-dom": "^18.3.1",
|
|
34
|
+
"typescript": "~5.6.2"
|
|
35
|
+
},
|
|
36
|
+
"browserslist": {
|
|
37
|
+
"production": [
|
|
38
|
+
">0.5%",
|
|
39
|
+
"not dead",
|
|
40
|
+
"not op_mini all"
|
|
41
|
+
],
|
|
42
|
+
"development": [
|
|
43
|
+
"last 3 chrome version",
|
|
44
|
+
"last 3 firefox version",
|
|
45
|
+
"last 5 safari version"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=20.0"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"docusaurus": "docusaurus",
|
|
53
|
+
"start": "docusaurus start",
|
|
54
|
+
"build": "docusaurus build",
|
|
55
|
+
"serve": "docusaurus serve",
|
|
56
|
+
"clear": "docusaurus clear",
|
|
57
|
+
"typecheck": "tsc"
|
|
58
|
+
}
|
|
6
59
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
root = true
|
|
2
|
+
|
|
3
|
+
[*]
|
|
4
|
+
charset = utf-8
|
|
5
|
+
end_of_line = lf
|
|
6
|
+
indent_size = 2
|
|
7
|
+
indent_style = space
|
|
8
|
+
insert_final_newline = true
|
|
9
|
+
trim_trailing_whitespace = true
|
|
10
|
+
|
|
11
|
+
[*.md]
|
|
12
|
+
trim_trailing_whitespace = false
|
|
13
|
+
max_line_length = off
|
|
14
|
+
|
|
15
|
+
[*.{yml,yaml}]
|
|
16
|
+
indent_size = 2
|
|
17
|
+
|
|
18
|
+
[*.json]
|
|
19
|
+
indent_size = 2
|
|
20
|
+
|
|
21
|
+
[Makefile]
|
|
22
|
+
indent_style = tab
|
|
23
|
+
|
|
24
|
+
[*.go]
|
|
25
|
+
indent_style = tab
|
|
26
|
+
|
|
27
|
+
[*.py]
|
|
28
|
+
indent_size = 4
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
|
|
2
|
+
|
|
3
|
+
# Source the nvm shell function.
|
|
4
|
+
# Handles: manual install ($HOME/.nvm), Homebrew on macOS, and WSL.
|
|
5
|
+
# On Windows with nvm-windows, nvm is already an executable in PATH — no sourcing needed.
|
|
6
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
7
|
+
. "$NVM_DIR/nvm.sh"
|
|
8
|
+
elif [ "$(uname -s 2>/dev/null)" = "Darwin" ] && command -v brew &>/dev/null; then
|
|
9
|
+
_nvm_sh="$(brew --prefix nvm 2>/dev/null)/nvm.sh"
|
|
10
|
+
[ -s "$_nvm_sh" ] && . "$_nvm_sh"
|
|
11
|
+
unset _nvm_sh
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
if [ -f ".nvmrc" ]; then
|
|
15
|
+
_node_version="$(tr -d '[:space:]' < .nvmrc)"
|
|
16
|
+
nvm install "$_node_version"
|
|
17
|
+
nvm use "$_node_version"
|
|
18
|
+
unset _node_version
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
# Ensure the pnpm shim declared in package.json#packageManager is active via Corepack.
|
|
22
|
+
# `corepack enable` is idempotent — safe to run on every cd.
|
|
23
|
+
if command -v corepack &>/dev/null; then
|
|
24
|
+
corepack enable pnpm
|
|
25
|
+
fi
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# [Project Name]
|
|
2
|
+
|
|
3
|
+
> **NEVER COMMIT CODE.** Do not run `git commit`, `git push`, `git merge`, `git rebase` or `git stash`, and do not create, switch or delete branches. Make the changes, leave them uncommitted in the working tree, and tell the person what you changed. A person reviews and commits every change.
|
|
4
|
+
|
|
5
|
+
## Project overview
|
|
6
|
+
|
|
7
|
+
[One paragraph: what this project does, who uses it, and why it exists.]
|
|
8
|
+
|
|
9
|
+
## Repository layout
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
[Directory tree at depth 2. Regenerate it after structural changes.]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Tech stack
|
|
16
|
+
|
|
17
|
+
| Layer | Technology | Version |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| Framework | [e.g. Next.js (App Router)] | [version] |
|
|
20
|
+
| Language | [e.g. TypeScript] | [version] |
|
|
21
|
+
| Styling | [e.g. Tailwind CSS] | [version] |
|
|
22
|
+
| Database | [database] | [version] |
|
|
23
|
+
| Hosting | [hosting platform] | — |
|
|
24
|
+
|
|
25
|
+
## Essential commands
|
|
26
|
+
|
|
27
|
+
| Task | Command |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Install | `pnpm install` |
|
|
30
|
+
| Develop | `pnpm dev` |
|
|
31
|
+
| Build | `pnpm build` |
|
|
32
|
+
| Test | `pnpm test` |
|
|
33
|
+
| Lint | `pnpm lint` |
|
|
34
|
+
| Format | `pnpm format` |
|
|
35
|
+
| Type-check | `pnpm typecheck` |
|
|
36
|
+
| Docs site | `pnpm docs:dev` (then open `/docs`) |
|
|
37
|
+
|
|
38
|
+
## Development workflow
|
|
39
|
+
|
|
40
|
+
- **Branches**: `<type>/<short-description>` in kebab-case, e.g. `feat/invoice-export`, `fix/login-redirect-loop`. Types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`. Never work directly on `main`.
|
|
41
|
+
- **Commits**: Conventional Commits (`feat: add invoice export`). **People commit — AI agents never do.**
|
|
42
|
+
- **Pull requests**: [review and CI requirements]
|
|
43
|
+
- **Merging**: [merge strategy, e.g. squash and merge]
|
|
44
|
+
|
|
45
|
+
## Environment variables
|
|
46
|
+
|
|
47
|
+
| Variable | Required | Description |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| `[VARIABLE_NAME]` | [Yes / No] | [What it is for] |
|
|
50
|
+
|
|
51
|
+
## Ontology
|
|
52
|
+
|
|
53
|
+
Activatus uses a fixed vocabulary, the ontology, in two parts:
|
|
54
|
+
|
|
55
|
+
- **Code words** — component, utils, Decision Doc and the rest — are defined in the code standards: https://activatus-code-standards.vercel.app/ontology
|
|
56
|
+
- **Product words** — what this project builds and how its work is planned — are defined in `docs/product/ontology.md`.
|
|
57
|
+
|
|
58
|
+
- **Read both before starting work.** If the project's ontology gives a code word a different meaning, the code standards win — point the difference out.
|
|
59
|
+
- **Use their terms** in code, docs, database names and messages — never a synonym. It is `utils`, not `helpers` or `utilities`.
|
|
60
|
+
- **Never use a term either ontology has removed.**
|
|
61
|
+
- If a person uses a word loosely, work out which ontology term they mean and use that term. **If you are not sure what a term means, ask.** Do not guess and do not invent a new term.
|
|
62
|
+
|
|
63
|
+
## Documentation
|
|
64
|
+
|
|
65
|
+
The project's docs are plain Markdown in `docs/`. **Every file is a Decision Doc**: it states one decision and why it was made.
|
|
66
|
+
|
|
67
|
+
- **Read them before starting work** — the three docs in `docs/overview/` first, then the docs for the area being changed. Read the files directly; do not start the docs site to read them.
|
|
68
|
+
- **Check each doc's Status.** `Decided` is settled. `Current plan` may change. `Under evaluation` and `Not started` are **not decisions** — do not treat them as one and do not invent one. Ask.
|
|
69
|
+
- **Never invent a product decision to unblock yourself.** If the docs do not answer it, stop and ask.
|
|
70
|
+
- **Update the docs in the same change.** If a change makes a doc wrong, fix the doc and change its Updated date.
|
|
71
|
+
- Do not edit `docsSite/` unless the task is about the docs viewer itself.
|
|
72
|
+
|
|
73
|
+
## Code standards
|
|
74
|
+
|
|
75
|
+
This project follows the Activatus Code Standards. They are installed as the `@activatus/code-standards` dev dependency: **read them in `node_modules/@activatus/code-standards/docs/`**, which is the exact version this project uses. The same pages are at https://activatus-code-standards.vercel.app for people.
|
|
76
|
+
|
|
77
|
+
**Code standards version:** [the major version of the installed `@activatus/code-standards` package when the standards were last applied]
|
|
78
|
+
|
|
79
|
+
This is the version the code follows. When the package is updated, read only the newer versions in `node_modules/@activatus/code-standards/docs/version-history.md`, make the changes they list, then update this number. See "Updating to a newer version" in `docs/Guides/setup.md`.
|
|
80
|
+
|
|
81
|
+
**Standards this project skips or changes** are listed, by number, in `docs/development/coding-standards.md`. Follow every other standard.
|
|
82
|
+
|
|
83
|
+
Follow these rules in every change:
|
|
84
|
+
|
|
85
|
+
- **Every function and component has a test file**, created in the same change. One test file tests one function or one component.
|
|
86
|
+
- **No file longer than 300 lines** (test files are exempt).
|
|
87
|
+
- **Every name is made of whole, human-readable words.** Variables, parameters, props, types, constants, form fields, files, folders, routes, database columns, scripts and environment variables — everything. No shortened words, no single letters, no numbered names, not even for a loop counter or an event handler. Full rule: Human-Readable Names in the code standards (https://activatus-code-standards.vercel.app/Standards/human-readable-names).
|
|
88
|
+
|
|
89
|
+
| Never | Always |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `btn`, `msg`, `val`, `(e) =>`, `(item, i) =>` | `button`, `message`, `value`, `(event) =>`, `(item, index) =>` |
|
|
92
|
+
| `inputRef` | `inputReference` |
|
|
93
|
+
| `deps`, `repo`, `env`, `timeoutMs`, `MAX_` | `dependencies`, `repository`, `environment`, `timeoutMilliseconds`, `MAXIMUM_` |
|
|
94
|
+
| `<T>`, `"sm" \| "lg"` | `<ItemType>`, `"small" \| "large"` |
|
|
95
|
+
| `name="email1"` | `name="emailAddress"` |
|
|
96
|
+
| `lib/`, `helpers/`, `utilities/`, `helpers.ts` | `library/`, `utils/`, a file named after what it does |
|
|
97
|
+
|
|
98
|
+
- **`id` is a word.** Write `id`, `userId`, `user_id` — never `identifier` and never `userID`. `identifier` is only for an outside system's separate field of that name (Linear's readable `ACT-73`).
|
|
99
|
+
- **Dictionary words stay short:** `id`, `docs`, `props`, `utils`, `app`, `url`, `api`, `uat`, `pdf`, `html`, `css`, `json`, `readme`. Case them as words: `imageUrl`, not `imageURL`. Any other short name is written in full. A new dictionary word is added to the Dictionary in the Human-Readable Names standard first (https://activatus-code-standards.vercel.app/Standards/human-readable-names#dictionary), never just used.
|
|
100
|
+
- **Names owned by someone else stay exactly as they are** — Linear's `id` and `pageInfo`, Node's `cwd` option and `process.env`, React's `ref` and `children`, shadcn/ui's `cn` helper, Next.js's `params`, `searchParams` and `LayoutProps`, HTML attributes, Tailwind classes. The rule is for names we write, not names from someone else's code. Renaming them breaks the code. Give the value a full-word name as soon as it comes into our code: `const workingDirectory = process.cwd();`, then pass `{ cwd: workingDirectory }`.
|
|
101
|
+
- **Form fields especially.** A field has one name everywhere it goes: the input's `name` and `id`, the form schema, the API request, the type and the database column (`emailAddress` / `email_address`). Every field has a visible `<label>` in plain English — never a placeholder instead. Option values are words (`"monthly"`), not numbers. Validation messages name the field and say what to do.
|
|
102
|
+
- **The linter only checks some names.** Folders, props, form fields, database columns, routes and environment variables are not linted — check every one of them yourself.
|
|
103
|
+
- **Always `const`.** Never `var`. Use `let` only when a value must be reassigned, with `// eslint-disable-next-line no-restricted-syntax -- <reason>` on the line above.
|
|
104
|
+
- **Arrow functions everywhere.** Never use the `function` keyword: `export const Button = () => {}`, not `export function Button() {}`.
|
|
105
|
+
- **No circular imports, ever.** A file never imports a file that imports it back. Inside a folder, import files directly — never through the folder's own `index.ts` — and never import a parent component from its sub-component.
|
|
106
|
+
- **Define before use.** A function or variable is written above the code that uses it.
|
|
107
|
+
- **A function does one thing.**
|
|
108
|
+
- **Functions, never classes.**
|
|
109
|
+
- **One parameter per function.** Use a single object when more than one value is needed.
|
|
110
|
+
- **Return early.** Never nest more than three levels deep.
|
|
111
|
+
- **No magic numbers or strings.** Use named constants.
|
|
112
|
+
- **No nested ternaries. No boolean flag parameters.**
|
|
113
|
+
- **No `any`, no non-null `!`, no `as` cast without a comment saying why.**
|
|
114
|
+
- **Named exports only**, except where a tool requires a default export.
|
|
115
|
+
- **Type names end in `Props` or `Type`.**
|
|
116
|
+
- **One component per file.** Server and client components live in separate files.
|
|
117
|
+
- **Component file order**: imports, component, variables, state, `useMemo` values, `useCallback` functions, effects, render. No inline functions in render.
|
|
118
|
+
- **Reusable functions live in a `utils/` folder** — global, section or component level — one folder per function, with an `index.ts`.
|
|
119
|
+
- **Components live where they are used:** Design System Components in `components/ui/`; components used on more than one page in `components/shared/`; components used by a few pages in one section in that section's route group (`app/(billing)/components/`); components used by one page in that page's `components/` folder. Start a new component beside its page, and move it up when a second page needs it. No `components/features/` folder.
|
|
120
|
+
- **Code file names are camelCase**; component files are PascalCase. **Anything that becomes a URL is kebab-case**: route folders and documentation folders and files (`docs/architecture/background-jobs.md`). CSS variables are kebab-case too.
|
|
121
|
+
- **Lay out with flexbox first**, and split layouts into child components. Only use CSS grid when specifically asked.
|
|
122
|
+
- **Style with Tailwind.** Colours come from the global colour palette in `app/globals.css` only — never a hard-coded or arbitrary colour. The design decisions are in `docs/design/design-system.md`.
|
|
123
|
+
- **Comments explain why, not what.** Never leave commented-out code.
|
|
124
|
+
- **Error messages say what happened and what to do.**
|
|
125
|
+
|
|
126
|
+
**Third-party code is exempt.** Code in `node_modules/` and `vendor/` belongs to someone else: do not lint it, do not reformat it, do not edit it to meet these rules.
|
|
127
|
+
|
|
128
|
+
**shadcn components are not third-party.** Code the shadcn CLI copies into the project is ours. Convert it to these standards in the same change that adds it — its own camelCase folder, one component per file, `types.ts`, `index.ts` and a test — keep only the parts that are used, and never put it in `vendor/`. **Do not change a component's props or behaviour** — only its styling. Components work identically in every Activatus project.
|
|
129
|
+
|
|
130
|
+
**Look before you build a component.** Check the project's `components/ui/`, then the Design System Components in the code standards, then other Activatus projects, then shadcn. Build to the props listed in the Design System Components; never invent new prop names for a component that is already listed. A component in `components/ui/` takes everything through props and never imports from features, services, stores or `app/`.
|
|
131
|
+
|
|
132
|
+
**Lint must pass before you finish.** Run `pnpm lint` and `pnpm test` before finishing any task, and fix every error by changing the code.
|
|
133
|
+
|
|
134
|
+
**Never switch a lint rule off to make an error go away.** Do not add `eslint-disable` comments, edit the ESLint config, or move files to hide them. The only exceptions are `let` and a type cast, each on a single line with a reason after ` -- `. If a rule seems impossible to satisfy, stop and ask.
|
|
135
|
+
|
|
136
|
+
When you report a lint error to the person, explain it in plain English: what is wrong, why it matters, and what you did to fix it.
|
|
137
|
+
|
|
138
|
+
## Available skills
|
|
139
|
+
|
|
140
|
+
Skill files live in `.agents/skills/`, mirrored to `.claude/commands/`.
|
|
141
|
+
|
|
142
|
+
| Skill | Invocation | What it does |
|
|
143
|
+
| --- | --- | --- |
|
|
144
|
+
| Lint | `/lint [path]` | Runs the linters in check-only mode and reports issues |
|
|
145
|
+
| Lint & fix | `/lintFix [path]` | Auto-fixes lint and formatting issues, then reports |
|
|
146
|
+
| Format | `/format [path]` | Formats files with Prettier |
|
|
147
|
+
| Code review | `/codeReview [branch, commit or path]` | Reviews changes for bugs and standards compliance |
|
|
148
|
+
| Update layout | `/updateLayout` | Regenerates the "Repository layout" section of this file |
|
|
149
|
+
| Security audit | `/securityAudit [path]` | Audits the code for common security problems |
|
|
150
|
+
| TypeScript | `/typescript [path]` | Tightens loose types and removes unsafe assertions |
|
|
151
|
+
| Test | `/test [path]` | Runs the tests and reports failures and missing tests |
|
|
152
|
+
|
|
153
|
+
## Out of scope for AI agents
|
|
154
|
+
|
|
155
|
+
- **Never commit code.** No `git commit`, `git push`, `git merge`, `git rebase` or `git stash`. Leave every change uncommitted for a person to review.
|
|
156
|
+
- Do not create, switch or delete branches.
|
|
157
|
+
- Do not write secrets, tokens or `.env` values into any file.
|
|
158
|
+
- Do not change dependencies or lockfiles unless the task requires it.
|
|
159
|
+
- Do not edit generated files, or third-party code in `node_modules/` or `vendor/`.
|
|
160
|
+
- [Add any other forbidden actions.]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# <Group> — <Menu item>
|
|
2
|
+
|
|
3
|
+
> One line: what this doc decides.
|
|
4
|
+
|
|
5
|
+
**Status:** Not started | Under evaluation | Current plan | Decided · **Updated:** YYYY-MM-DD
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
## Why
|
|
10
|
+
|
|
11
|
+
## Details
|
|
12
|
+
|
|
13
|
+
## Alternatives considered
|
|
14
|
+
|
|
15
|
+
## Current implementation
|
|
16
|
+
|
|
17
|
+
## Related
|
|
18
|
+
|
|
19
|
+
## Retro Feedback
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# AI — Agent Harness
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# AI — Agents
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# AI — Architecture
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# AI — Context
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# AI — Model Routing
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# AI — Models
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# AI — Retrieval
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# AI — Tools
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Authentication
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Backend
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Background Jobs
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Backups
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Caching
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — CI/CD
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Disaster Recovery
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Environments
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Frontend
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Hosting
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Architecture — Observability
|
|
2
|
+
|
|
3
|
+
> [One line: what this doc decides.]
|
|
4
|
+
|
|
5
|
+
**Status:** Not started · **Updated:** [YYYY-MM-DD]
|
|
6
|
+
|
|
7
|
+
## Decision
|
|
8
|
+
|
|
9
|
+
[What was decided.]
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
[The reasons.]
|
|
14
|
+
|
|
15
|
+
## Related
|
|
16
|
+
|
|
17
|
+
- [Link to related docs with a relative path, e.g. `[Future](../scope/future.md)`]
|