@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.
Files changed (183) hide show
  1. package/README.md +200 -2
  2. package/docs/Guides/_category_.json +4 -0
  3. package/docs/Guides/component-library-workflow.md +182 -0
  4. package/docs/Guides/migrating.md +144 -0
  5. package/docs/Guides/setup.md +130 -0
  6. package/docs/Standards/_category_.json +4 -0
  7. package/docs/Standards/agent-skills.md +125 -0
  8. package/docs/Standards/agent-specs.md +89 -0
  9. package/docs/Standards/branch-naming.md +66 -0
  10. package/docs/Standards/conventional-commits.md +189 -0
  11. package/docs/Standards/direnv.mdx +249 -0
  12. package/docs/Standards/documentation.md +311 -0
  13. package/docs/Standards/editorconfig.md +72 -0
  14. package/docs/Standards/eslint.md +709 -0
  15. package/docs/Standards/human-readable-names.md +234 -0
  16. package/docs/Standards/lint-errors.md +139 -0
  17. package/docs/Standards/prettier.md +97 -0
  18. package/docs/Standards/readable-code.md +540 -0
  19. package/docs/Standards/stylelint.md +178 -0
  20. package/docs/Standards/styling.md +284 -0
  21. package/docs/Standards/tech-stack.md +156 -0
  22. package/docs/Structure/_category_.json +4 -0
  23. package/docs/Structure/api-routes.md +118 -0
  24. package/docs/Structure/component-organization.md +519 -0
  25. package/docs/Structure/folder-structure.md +353 -0
  26. package/docs/Structure/import-organization.md +158 -0
  27. package/docs/Structure/naming-conventions.md +336 -0
  28. package/docs/design-system-components.md +117 -0
  29. package/docs/intro.md +46 -0
  30. package/docs/ontology.md +132 -0
  31. package/docs/templates.mdx +419 -0
  32. package/docs/version-history.md +211 -0
  33. package/package.json +56 -3
  34. package/static/templates/.commitlintrc.json +3 -0
  35. package/static/templates/.editorconfig +28 -0
  36. package/static/templates/.envrc +25 -0
  37. package/static/templates/.nvmrc +1 -0
  38. package/static/templates/AGENTS.md +160 -0
  39. package/static/templates/decision-doc.md +19 -0
  40. package/static/templates/docs/ai/agent-harness.md +17 -0
  41. package/static/templates/docs/ai/agents.md +17 -0
  42. package/static/templates/docs/ai/architecture.md +17 -0
  43. package/static/templates/docs/ai/context.md +17 -0
  44. package/static/templates/docs/ai/model-routing.md +17 -0
  45. package/static/templates/docs/ai/models.md +17 -0
  46. package/static/templates/docs/ai/retrieval.md +17 -0
  47. package/static/templates/docs/ai/tools.md +17 -0
  48. package/static/templates/docs/architecture/authentication.md +17 -0
  49. package/static/templates/docs/architecture/backend.md +17 -0
  50. package/static/templates/docs/architecture/background-jobs.md +17 -0
  51. package/static/templates/docs/architecture/backups.md +17 -0
  52. package/static/templates/docs/architecture/caching.md +17 -0
  53. package/static/templates/docs/architecture/ci-cd.md +17 -0
  54. package/static/templates/docs/architecture/disaster-recovery.md +17 -0
  55. package/static/templates/docs/architecture/environments.md +17 -0
  56. package/static/templates/docs/architecture/frontend.md +17 -0
  57. package/static/templates/docs/architecture/hosting.md +17 -0
  58. package/static/templates/docs/architecture/observability.md +17 -0
  59. package/static/templates/docs/architecture/realtime.md +17 -0
  60. package/static/templates/docs/architecture/search.md +17 -0
  61. package/static/templates/docs/architecture/services.md +17 -0
  62. package/static/templates/docs/architecture/state-management.md +17 -0
  63. package/static/templates/docs/architecture/storage.md +17 -0
  64. package/static/templates/docs/architecture/system.md +17 -0
  65. package/static/templates/docs/business/buying-trigger.md +17 -0
  66. package/static/templates/docs/business/customer-value.md +17 -0
  67. package/static/templates/docs/business/customer.md +17 -0
  68. package/static/templates/docs/business/defensibility.md +17 -0
  69. package/static/templates/docs/business/growth.md +17 -0
  70. package/static/templates/docs/business/pricing.md +17 -0
  71. package/static/templates/docs/business/revenue-model.md +17 -0
  72. package/static/templates/docs/business/unit-economics.md +17 -0
  73. package/static/templates/docs/data/analytics.md +17 -0
  74. package/static/templates/docs/data/audit.md +17 -0
  75. package/static/templates/docs/data/database.md +17 -0
  76. package/static/templates/docs/data/indexing.md +17 -0
  77. package/static/templates/docs/data/migrations.md +17 -0
  78. package/static/templates/docs/data/model.md +17 -0
  79. package/static/templates/docs/data/retention.md +17 -0
  80. package/static/templates/docs/data/schema.md +17 -0
  81. package/static/templates/docs/deployment/approval.md +17 -0
  82. package/static/templates/docs/deployment/live-verification.md +17 -0
  83. package/static/templates/docs/deployment/process.md +17 -0
  84. package/static/templates/docs/deployment/rollback.md +17 -0
  85. package/static/templates/docs/design/design-system.md +17 -0
  86. package/static/templates/docs/design/errors.md +17 -0
  87. package/static/templates/docs/design/feedback.md +17 -0
  88. package/static/templates/docs/design/interactions.md +17 -0
  89. package/static/templates/docs/design/layout.md +17 -0
  90. package/static/templates/docs/design/navigation.md +17 -0
  91. package/static/templates/docs/design/principles.md +17 -0
  92. package/static/templates/docs/design/responsive.md +17 -0
  93. package/static/templates/docs/development/branching.md +17 -0
  94. package/static/templates/docs/development/code-quality.md +17 -0
  95. package/static/templates/docs/development/coding-standards.md +17 -0
  96. package/static/templates/docs/development/commits.md +17 -0
  97. package/static/templates/docs/development/merge-strategy.md +17 -0
  98. package/static/templates/docs/development/process.md +17 -0
  99. package/static/templates/docs/development/pull-requests.md +17 -0
  100. package/static/templates/docs/experience/accessibility.md +17 -0
  101. package/static/templates/docs/experience/aha-moment.md +17 -0
  102. package/static/templates/docs/experience/anti-experience.md +17 -0
  103. package/static/templates/docs/experience/friction.md +17 -0
  104. package/static/templates/docs/experience/outcomes.md +17 -0
  105. package/static/templates/docs/experience/principles.md +17 -0
  106. package/static/templates/docs/experience/retention.md +17 -0
  107. package/static/templates/docs/experience/sharing.md +17 -0
  108. package/static/templates/docs/overview/how-it-works.md +17 -0
  109. package/static/templates/docs/overview/what-is-it.md +17 -0
  110. package/static/templates/docs/overview/writing-docs.md +16 -0
  111. package/static/templates/docs/pitch/alternatives.md +17 -0
  112. package/static/templates/docs/pitch/assumptions.md +17 -0
  113. package/static/templates/docs/pitch/audience.md +17 -0
  114. package/static/templates/docs/pitch/concept.md +17 -0
  115. package/static/templates/docs/pitch/differentiators.md +17 -0
  116. package/static/templates/docs/pitch/outcomes.md +17 -0
  117. package/static/templates/docs/pitch/problem.md +17 -0
  118. package/static/templates/docs/pitch/product-market-fit.md +17 -0
  119. package/static/templates/docs/pitch/success-criteria.md +17 -0
  120. package/static/templates/docs/pitch/validation.md +17 -0
  121. package/static/templates/docs/pitch/value-proposition.md +17 -0
  122. package/static/templates/docs/pitch/vision.md +17 -0
  123. package/static/templates/docs/scope/core.md +17 -0
  124. package/static/templates/docs/scope/exclusions.md +17 -0
  125. package/static/templates/docs/scope/future.md +17 -0
  126. package/static/templates/docs/scope/launch.md +17 -0
  127. package/static/templates/docs/scope/post-launch.md +17 -0
  128. package/static/templates/docs/scope/priorities.md +17 -0
  129. package/static/templates/docs/scope/quality-bar.md +17 -0
  130. package/static/templates/docs/security/audit.md +17 -0
  131. package/static/templates/docs/security/data-access.md +17 -0
  132. package/static/templates/docs/security/logging.md +17 -0
  133. package/static/templates/docs/security/privacy.md +17 -0
  134. package/static/templates/docs/security/secrets.md +17 -0
  135. package/static/templates/docs/security/threat-model.md +17 -0
  136. package/static/templates/docs/testing/end-to-end.md +17 -0
  137. package/static/templates/docs/testing/integration.md +17 -0
  138. package/static/templates/docs/testing/regression.md +17 -0
  139. package/static/templates/docs/testing/security.md +17 -0
  140. package/static/templates/docs/testing/strategy.md +17 -0
  141. package/static/templates/docs/testing/test-data.md +17 -0
  142. package/static/templates/docs/testing/unit.md +17 -0
  143. package/static/templates/docs/uat/checks.md +17 -0
  144. package/static/templates/docs/uat/strategy.md +17 -0
  145. package/static/templates/docs/users/permissions.md +17 -0
  146. package/static/templates/docs/users/roles.md +17 -0
  147. package/static/templates/docs/users/user-types.md +17 -0
  148. package/static/templates/docs/workflows/assignment.md +17 -0
  149. package/static/templates/docs/workflows/bugfix.md +17 -0
  150. package/static/templates/docs/workflows/dependencies.md +17 -0
  151. package/static/templates/docs/workflows/deployment.md +17 -0
  152. package/static/templates/docs/workflows/development.md +17 -0
  153. package/static/templates/docs/workflows/planning.md +17 -0
  154. package/static/templates/docs/workflows/review.md +17 -0
  155. package/static/templates/docs/workflows/uat.md +17 -0
  156. package/static/templates/docsSite/docusaurus.config.ts +119 -0
  157. package/static/templates/docsSite/gitignore.txt +3 -0
  158. package/static/templates/docsSite/package.json.txt +42 -0
  159. package/static/templates/docsSite/pnpm-workspace.yaml +2 -0
  160. package/static/templates/docsSite/sidebars.ts +8 -0
  161. package/static/templates/docsSite/src/css/custom.css +1 -0
  162. package/static/templates/docsSite/src/pages/index.tsx +9 -0
  163. package/static/templates/docsSite/static/images/logo.svg +4 -0
  164. package/static/templates/docsSite/tsconfig.json +7 -0
  165. package/static/templates/eslint/base/eslint.config.mjs +79 -0
  166. package/static/templates/eslint/nextjs/eslint.config.mjs +137 -0
  167. package/static/templates/eslint/react/eslint.config.mjs +138 -0
  168. package/static/templates/eslint/typescript/eslint.config.mjs +126 -0
  169. package/static/templates/globals.css +16 -0
  170. package/static/templates/husky/commit-msg +1 -0
  171. package/static/templates/husky/pre-commit +1 -0
  172. package/static/templates/next.config.mjs +18 -0
  173. package/static/templates/prettier.config.js +17 -0
  174. package/static/templates/skills/codeReview.md +31 -0
  175. package/static/templates/skills/format.md +18 -0
  176. package/static/templates/skills/lint.md +21 -0
  177. package/static/templates/skills/lintFix.md +24 -0
  178. package/static/templates/skills/securityAudit.md +28 -0
  179. package/static/templates/skills/test.md +24 -0
  180. package/static/templates/skills/typescript.md +28 -0
  181. package/static/templates/skills/updateLayout.md +20 -0
  182. package/static/templates/stylelint/css/stylelint.config.mjs +28 -0
  183. package/static/templates/stylelint/scss/stylelint.config.mjs +10 -0
@@ -0,0 +1,130 @@
1
+ ---
2
+ sidebar_position: 2
3
+ sidebar_label: "Setup"
4
+ ---
5
+
6
+ # Setting Up a Project
7
+
8
+ > For the AI agent. A person has told you to follow the Activatus Code Standards in their project. This is everything you do, in order.
9
+
10
+ The person creates the app themselves — with `create-next-app`, Expo or anything else — and tells you to follow the standards. **Do not ask which framework the project uses.** Look at the project: its `package.json` and files tell you. The person only answers the questions below and checks your work. They never run a command.
11
+
12
+ ## 1. Install the standards
13
+
14
+ ```bash
15
+ pnpm add -D @activatus/code-standards
16
+ ```
17
+
18
+ The standards are now in `node_modules/@activatus/code-standards/`:
19
+
20
+ | Folder | What it holds |
21
+ | ------------------------- | ------------------------------------------------------------------------------------------ |
22
+ | `docs/` | Every standard, as Markdown. The same pages as https://activatus-code-standards.vercel.app |
23
+ | `docs/version-history.md` | What changed in each version, and what a project has to do about it |
24
+ | `static/templates/` | The config files to copy: `AGENTS.md`, ESLint, Prettier, Stylelint and the rest |
25
+
26
+ **Read the standards from `node_modules`, not the website.** The installed package is the exact version the project uses. The package version is the standards version: `2.0.0` is version 2.
27
+
28
+ ## 2. Work out where the project is
29
+
30
+ Open the project's `AGENTS.md` and look for `**Code standards version:**`.
31
+
32
+ | What you find | What it means | Go to |
33
+ | -------------------------------------------- | ------------------------------------ | ----------------------------------------------------------- |
34
+ | No `AGENTS.md`, or no code standards version | The standards have never been set up | [3. Agree the standards](#3-agree-the-standards) |
35
+ | A version lower than the installed package | The project follows an older version | [Updating to a newer version](#updating-to-a-newer-version) |
36
+ | The same version as the installed package | Already up to date | Nothing to do. Tell the person |
37
+
38
+ ## 3. Agree the standards
39
+
40
+ **Print this list to the person exactly as it is written**, with the same numbers, so they can answer with numbers:
41
+
42
+ ```text
43
+ These are the Activatus Code Standards. Want anything different?
44
+ Tell me the numbers to skip or change, or say "all good".
45
+
46
+ 1. Human-readable names: every name is whole words, using the Dictionary
47
+ 2. Readable code: files under 300 lines, one job per function, one parameter, return early, no magic numbers
48
+ 3. Arrow functions and const only, named exports, no classes
49
+ 4. Every function and component has a test file
50
+ 5. Strict TypeScript: no any, no !, no unexplained as; type names end in Props or Type
51
+ 6. ESLint, with the standard config
52
+ 7. Prettier, with the Tailwind class-sorting plugin
53
+ 8. Stylelint, for any hand-written CSS
54
+ 9. EditorConfig
55
+ 10. Node version set by .nvmrc and direnv
56
+ 11. Styling: Tailwind, flexbox first, colours only from the global palette
57
+ 12. Folder structure: folders at the project root, functions in utils/
58
+ 13. Components live where they are used: components/ui/, components/shared/, or beside their page
59
+ 14. Component files in a fixed order, with index.ts exports, and server and client code in separate files
60
+ 15. Design System Components: every project builds the standard components with the same props
61
+ 16. Imports: no circular imports, import from folders not files
62
+ 17. API routes: one folder per route, kebab-case
63
+ 18. Docs: every file in docs/ is a Decision Doc, shown at /docs by the docs site
64
+ 19. Conventional Commits, checked by Husky, with pnpm lint before every commit
65
+ 20. Branch names: type/short-description
66
+ 21. AGENTS.md and the eight agent skills
67
+ 22. AI agents never commit, push or make branches (strict no commit)
68
+ 23. The Ontology: the shared words for code
69
+ ```
70
+
71
+ Then wait for the answer.
72
+
73
+ | The person says | Do |
74
+ | --------------------------------------------------------- | ----------------------------- |
75
+ | "All good" | Apply every standard |
76
+ | "Skip 7" | Apply every standard except 7 |
77
+ | "Change 22: agents can commit when I say I'm on my phone" | Apply 22 as they describe it |
78
+ | Something unclear | Ask. Do not guess |
79
+
80
+ **Record the answer** in `docs/development/coding-standards.md`, under "Details". For each skipped or changed standard, write its number, its name, what is different, and the reason the person gave. If nothing is different, write "No differences". Copy the file from `static/templates/docs/development/coding-standards.md` if it does not exist.
81
+
82
+ If standard 22 is changed, also replace the "NEVER COMMIT CODE" lines in `AGENTS.md` with the person's rule. See [A project can choose otherwise](/Standards/agent-specs#a-project-can-choose-otherwise).
83
+
84
+ ## 4. Apply the standards
85
+
86
+ Do only the standards the person agreed to. Copy every file from `node_modules/@activatus/code-standards/static/templates/` — never write a config file from scratch.
87
+
88
+ **An existing project with code already in it** also needs its code brought up to the standards. Do that with [Migrating an Existing Project](/Guides/migrating), one stage per pull request, after the config files below are in place.
89
+
90
+ | Standard | What to set up |
91
+ | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
92
+ | 6. ESLint | Copy the config for the project's framework from `static/templates/eslint/`: `base`, `typescript`, `react` or `nextjs`. Install the packages listed on the [ESLint page](/Standards/eslint). Add the scripts `"lint": "eslint ."` and `"lint:fix": "eslint . --fix"` |
93
+ | 7. Prettier | `pnpm add -D prettier prettier-plugin-tailwindcss`. Copy `static/templates/prettier.config.js`. Add the scripts `"format": "prettier --write ."` and `"format:check": "prettier --check ."` |
94
+ | 8. Stylelint | Only if the project has hand-written CSS or SCSS. Copy the config from `static/templates/stylelint/css/` or `scss/`. See [Stylelint](/Standards/stylelint) |
95
+ | 9. EditorConfig | Copy `static/templates/.editorconfig` |
96
+ | 10. Node version | Copy `static/templates/.nvmrc` and `static/templates/.envrc`. See [direnv + nvm](/Standards/direnv) |
97
+ | 11. Styling | Copy `static/templates/globals.css` to `app/globals.css`. Ask the person for the project's colours, and replace the example palette |
98
+ | 18. Docs | Copy `static/templates/docs/` to `docs/` and `static/templates/docsSite/` to `docsSite/`. Add the `/docs` route from `static/templates/next.config.mjs`. See [Setting it up](/Standards/documentation#-setting-it-up) |
99
+ | 19. Commits | Copy `static/templates/.commitlintrc.json` and the two hooks in `static/templates/husky/`. Add the lint hook last, once `pnpm lint` passes. See [Enforcing commit messages](/Standards/conventional-commits#enforcing-commit-messages) |
100
+ | 21. AGENTS.md and skills | Copy `static/templates/AGENTS.md` to the project root and fill in every `[placeholder]`. If the framework wrote its own `AGENTS.md` (Next.js does), keep any instruction it gives about reading the framework's own docs. Copy `static/templates/skills/` into `.agents/skills/`, and again into `.claude/commands/` |
101
+
102
+ The other standards are rules for how code is written. There is nothing to install for them: follow them in every change.
103
+
104
+ **Finish by:**
105
+
106
+ 1. Setting `**Code standards version:**` in `AGENTS.md` to the installed package's major version.
107
+ 2. Running `pnpm lint`, `pnpm format:check` and the tests.
108
+ 3. Telling the person what you set up, which standards they skipped, and anything only they can do, such as filling in a secret in `.env.local`.
109
+
110
+ ---
111
+
112
+ ## Updating to a newer version
113
+
114
+ The project already follows the standards, and a newer version is out.
115
+
116
+ 1. **Note the project's version.** Read `**Code standards version:**` in `AGENTS.md`. This is the version the code follows.
117
+ 2. **Update the package:**
118
+
119
+ ```bash
120
+ pnpm update @activatus/code-standards --latest
121
+ ```
122
+
123
+ Its major version is now the newest version.
124
+
125
+ 3. **Read `node_modules/@activatus/code-standards/docs/version-history.md`**, but only the versions newer than the project's. Do not re-read the rest of the standards.
126
+ 4. **Skip any change to a standard the project opted out of.** The opt-outs are listed in `docs/development/coding-standards.md`.
127
+ 5. **Do every other change** as its "What to do" says, and run its "How to check" search. One pull request per kind of change.
128
+ 6. **Set `**Code standards version:**`** in `AGENTS.md` to the new version, and tell the person what changed.
129
+
130
+ See the [Version History](/version-history) for the full update rules.
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "Standards",
3
+ "position": 6
4
+ }
@@ -0,0 +1,125 @@
1
+ ---
2
+ sidebar_position: 8
3
+ ---
4
+
5
+ # Agent Skills
6
+
7
+ A skill is a reusable instruction file an agent runs when you type `/lint`, `/format`, `/codeReview`. Every Activatus repository provides the same [standard set](/Standards/agent-specs#standard-skills), copied from the [Templates page](/templates#skills). This page is the standard they are written to.
8
+
9
+ Skills are shared, versioned, and executed with real tool access. A vague one wastes a run; a wrong one edits files it was never meant to touch. They get the same review as any other code.
10
+
11
+ ## Where skills live
12
+
13
+ One canonical copy, one mirror:
14
+
15
+ | Path | Role |
16
+ | --- | --- |
17
+ | `.agents/skills/*.md` | **Canonical.** Portable location any compatible agent reads. The only copy you edit. |
18
+ | `.claude/commands/*.md` | Claude Code mirror, exposed as `/name`. |
19
+
20
+ Keep the mirror identical to the canonical copy — edit the skill in `.agents/skills/`, then copy it across.
21
+
22
+ :::note[Why two locations rather than one format]
23
+
24
+ `.claude/commands/` is Claude Code's older flat-file layout; its newer equivalent is a directory per skill (`.claude/skills/<name>/SKILL.md`). Activatus stays on flat files because the same file has to serve `.agents/skills/` for non-Claude agents, and a flat `.md` is the only shape both read. Revisit this if bundled resources (`scripts/`, `references/`) are ever needed — that is what the directory format buys.
25
+
26
+ :::
27
+
28
+ ## Frontmatter
29
+
30
+ Every skill starts with YAML frontmatter. Without it the agent falls back to guessing from the first line of the body.
31
+
32
+ ```markdown
33
+ ---
34
+ name: lint
35
+ description: Run all linters in check-only mode and report issues
36
+ argument-hint: "[path]"
37
+ allowed-tools: Read, Glob, Grep, Bash(pnpm lint:*), Bash(eslint:*)
38
+ ---
39
+
40
+ Run all configured linters and report issues without modifying any files.
41
+ ```
42
+
43
+ | Field | Required | Purpose |
44
+ | --- | --- | --- |
45
+ | `name` | Yes | The invocation name, in camelCase. Must match the filename. |
46
+ | `description` | Yes | One line, **under 60 characters**. How an agent decides to use it. |
47
+ | `argument-hint` | If it takes arguments | Shown during autocomplete. |
48
+ | `allowed-tools` | Strongly encouraged | The tools the skill may use. See below. |
49
+ | `model` | No | Pin only for genuinely mechanical skills. |
50
+ | `disable-model-invocation` | No | Set when a skill must only ever be run by a human. |
51
+
52
+ Quote any `argument-hint` that starts with `[`, or YAML parses it as a list:
53
+
54
+ ```yaml
55
+ argument-hint: "[path]" # string
56
+ argument-hint: [path] # a one-element array — wrong
57
+ ```
58
+
59
+ ## `allowed-tools` is the contract
60
+
61
+ Prose like "this skill is read-only" is a request. `allowed-tools` is the enforcement. Whatever a skill's body promises not to do, the allowlist should make impossible:
62
+
63
+ | The skill says | So the allowlist omits |
64
+ | --- | --- |
65
+ | "Do NOT make file changes" | `Edit`, `Write` |
66
+ | "Do NOT auto-fix" | `Edit`, `Write` |
67
+ | "Do NOT stage or commit" | every `Bash(git …)` |
68
+ | "Do NOT push" | `Bash(git push:*)` |
69
+
70
+ Three rules follow from this:
71
+
72
+ 1. **Every command the body tells the agent to run must be allowlisted.** A body that says `eslint $ARGUMENTS` under an allowlist of only `Bash(pnpm exec eslint:*)` blocks itself halfway through. List each form the body actually uses.
73
+ 2. **Grant the narrowest set that still works.** `Bash(pnpm lint:*), Bash(eslint:*)` over a bare `Bash`.
74
+ 3. **Never grant `git commit` or `git push`.** [Agents never commit code](/Standards/agent-specs#agents-never-commit-code), so no skill is allowed to.
75
+
76
+ Be honest about the limit: patterns gate the command, not its flags. `Bash(eslint:*)` still permits `eslint --fix`. The allowlist reliably prevents a skill from reaching for a whole *category* of tool; keep the prose instruction as well for anything finer.
77
+
78
+ ## Write for the agent, not the user
79
+
80
+ A skill body is the agent's instructions. Write directives, not a description of what the user is about to experience.
81
+
82
+ ```markdown
83
+ <!-- Good — tells the agent what to do -->
84
+
85
+ Run each applicable linter in check-only mode and report the findings grouped by file.
86
+
87
+ <!-- Bad — tells the user what will happen -->
88
+
89
+ This command will check your code and give you a nice report.
90
+ ```
91
+
92
+ ## Structure
93
+
94
+ - **Number the steps.** Agents follow ordered lists more reliably than prose paragraphs.
95
+
96
+ - **Indent sub-steps by three spaces**, not two. An ordered item's content offset is three characters (`1. `), and at two spaces CommonMark — and Prettier — will lift the bullets out into a separate list and break the numbering.
97
+
98
+ ```markdown
99
+ 2. Run each applicable linter:
100
+ - ESLint: `eslint $ARGUMENTS`
101
+ - Stylelint: `stylelint "**/*.{css,scss}"`
102
+ 3. Collect the warnings.
103
+ ```
104
+
105
+ - **State the contract explicitly**, in the body as well as the frontmatter — `Do NOT stage or commit`, `Do NOT push`.
106
+
107
+ - **Say what to do when a prerequisite is missing.** Naming the fallback is what stops an agent from quietly substituting a worse one.
108
+
109
+ ## Prefer the project's own scripts
110
+
111
+ Respect the project's own scripts. `pnpm lint` picks up workspace configuration that a bare `eslint .` at the root will miss, and in a monorepo the bare form is simply wrong.
112
+
113
+ ## Checklist
114
+
115
+ Before merging a skill:
116
+
117
+ - [ ] `name` matches the filename
118
+ - [ ] `description` is one line, under 60 characters
119
+ - [ ] `argument-hint` present if it takes arguments, and quoted if it starts with `[`
120
+ - [ ] `allowed-tools` omits everything the body promises not to do
121
+ - [ ] `allowed-tools` includes every command the body does invoke
122
+ - [ ] Body is written as instructions to the agent
123
+ - [ ] Sub-steps indented three spaces
124
+ - [ ] Prettier leaves the file unchanged
125
+ - [ ] `.claude/commands/` mirror matches `.agents/skills/`
@@ -0,0 +1,89 @@
1
+ ---
2
+ sidebar_position: 7
3
+ sidebar_label: "AGENTS.md"
4
+ ---
5
+
6
+ # AGENTS.md Specifications
7
+
8
+ Every Activatus repository must have an `AGENTS.md` in its root. This file gives AI coding agents (Claude Code, Copilot, Cursor, etc.) the context they need to work effectively without repeated explanation.
9
+
10
+ ## Agents never commit code
11
+
12
+ **An AI agent never commits.** It does not run `git commit`, `git push`, `git merge`, `git rebase` or `git stash`, and it does not create, switch or delete branches.
13
+
14
+ The agent makes the changes, leaves them uncommitted in the working tree, and says what it changed. A person reviews the changes and commits them.
15
+
16
+ Every `AGENTS.md` states this at the very top and again under "Out of scope for AI agents". The [template](/templates#agents) already does.
17
+
18
+ ### A project can choose otherwise
19
+
20
+ **Strict no commit is the default.** It is standard 22 in the list the person agrees to during [Setup](/Guides/setup#3-agree-the-standards), so they can change it then. Or they can be asked directly:
21
+
22
+ > Should AI agents be allowed to commit in this project, or is it strict no commit?
23
+
24
+ | Answer | What goes in `AGENTS.md` |
25
+ | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | **Strict no commit** (the default) | The template as it is |
27
+ | **Agents may commit** | Replace the "NEVER COMMIT CODE" lines with the project's own rule, saying exactly which agents may commit, push and open Pull Requests, and when. A tool built to ship code with AI, such as Launchpad, chooses this |
28
+
29
+ A person can also allow it for one piece of work, such as when they are away from their computer. That permission lasts for that piece of work only, and never changes the project's rule.
30
+
31
+ ## Template
32
+
33
+ Start from the [AGENTS.md template](/templates#agents) and replace every `[placeholder]`.
34
+
35
+ ## Required sections
36
+
37
+ Every `AGENTS.md` must include these sections. Monorepos (`pnpm-workspace.yaml`, Turborepo, Nx, etc.) also require a **Workspace packages** table listing each package, its path and a one-line description.
38
+
39
+ | Section | Purpose |
40
+ | -------------------------- | ----------------------------------------------------------------------------------------- |
41
+ | Project overview | One paragraph: what it does, who uses it, why it exists |
42
+ | Repository layout | Directory tree at depth 2 |
43
+ | Tech stack | Language, runtime, framework, database, infra (with versions) |
44
+ | Essential commands | Install, dev, build, test, lint, type-check |
45
+ | Development workflow | [Branch naming](/Standards/branch-naming), commit format, PR requirements, merge strategy |
46
+ | Environment variables | All required and optional env vars with descriptions |
47
+ | Ontology | Link to the [ontology](/ontology), and the instruction to read it and use its terms |
48
+ | Documentation | Where the project's docs are, and the instruction to read them before starting work |
49
+ | Code standards | Link to these standards and the rules agents must follow in every change |
50
+ | Available skills | Table of the agent skills the project provides |
51
+ | Out of scope for AI agents | Explicit list of forbidden agent actions — always including "never commit code" |
52
+
53
+ ## Standard skills
54
+
55
+ Every project provides these eight skills. **The files are ready to copy from the [Templates page](/templates#skills)** — copy them into `.agents/skills/`, and again into `.claude/commands/` for Claude Code. They are written to the [agent skills standard](/Standards/agent-skills).
56
+
57
+ | Skill | Invocation | What it does |
58
+ | -------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
59
+ | Lint | `/lint [path]` | Runs ESLint (and Stylelint if configured) in check-only mode; reports all issues grouped by file |
60
+ | Lint & fix | `/lintFix [path]` | Runs ESLint and Stylelint in fix mode, then Prettier; reports what changed and what is left |
61
+ | Format | `/format [path]` | Runs Prettier in write mode; reports reformatted files |
62
+ | Code review | `/codeReview [branch, commit or path]` | Reviews changes for correctness, security, types, tests and standards compliance. Report only |
63
+ | Update layout | `/updateLayout` | Regenerates the "Repository layout" section of `AGENTS.md` (and "Workspace packages" in monorepos) |
64
+ | Security audit | `/securityAudit [path]` | Audits dependencies and code for secrets, missing access control, unvalidated input and injection. Report only |
65
+ | TypeScript | `/typescript [path]` | Tightens loose types and removes `any`, `!` and unexplained `as` |
66
+ | Test | `/test [path]` | Runs the test suite; reports failures grouped by cause, tests that never ran, and files missing a test |
67
+
68
+ Skill files are named in camelCase (`lintFix.md`), so the invocation is camelCase too (`/lintFix`). They are not documentation pages and have no URL, so the kebab-case rule for docs does not apply.
69
+
70
+ No skill commits code — see [Agents never commit code](#agents-never-commit-code).
71
+
72
+ ### Skill locations
73
+
74
+ Skills are stored in two locations so they work with different tooling:
75
+
76
+ | Path | Used by |
77
+ | ------------------- | ----------------------------------------- |
78
+ | `.agents/skills/` | General agent discovery convention |
79
+ | `.claude/commands/` | Claude Code slash command system (mirror) |
80
+
81
+ ## Writing guidelines
82
+
83
+ | Do | Don't |
84
+ | ------------------------------------------------------ | -------------------------------------------- |
85
+ | Use concrete commands (`pnpm test`) | Use vague instructions ("run the tests") |
86
+ | State constraints explicitly ("do not push to `main`") | Assume the agent knows your branching policy |
87
+ | Include version numbers in the tech stack | Leave versions ambiguous |
88
+ | Keep it under ~300 lines | Write a novel — agents have context limits |
89
+ | Run `/updateLayout` after structural changes | Let the directory tree go stale |
@@ -0,0 +1,66 @@
1
+ ---
2
+ sidebar_position: 6.5
3
+ ---
4
+
5
+ # Branch Naming
6
+
7
+ Every branch name says what kind of work it holds and what the work is.
8
+
9
+ ## Format
10
+
11
+ ```text
12
+ <type>/<short-description>
13
+ ```
14
+
15
+ ```text
16
+ feat/invoice-export
17
+ fix/login-redirect-loop
18
+ docs/update-readme
19
+ ```
20
+
21
+ ## Rules
22
+
23
+ - **Start with a type**, followed by a slash. The types are the same as [Conventional Commits](/Standards/conventional-commits#type-reference).
24
+ - **Describe the work in two to five words**, in lower-case kebab-case. Branch names are kebab-case, like route folders, documentation files and CSS variables — it is the Git convention, and it is safe on every operating system.
25
+ - **Use full English words**, the same as in code: `fix/button-alignment`, not `fix/btn-align`.
26
+ - **One piece of work per branch.** If the description needs the word "and", it is two branches.
27
+ - **Never work directly on `main`.**
28
+
29
+ ## Types
30
+
31
+ | Type | Use for | Example |
32
+ | ---------- | -------------------------------------- | ----------------------------- |
33
+ | `feat` | A new feature | `feat/invoice-export` |
34
+ | `fix` | A bug fix | `fix/login-redirect-loop` |
35
+ | `docs` | Documentation only | `docs/update-readme` |
36
+ | `refactor` | Restructuring with no behaviour change | `refactor/split-user-service` |
37
+ | `test` | Adding or correcting tests | `test/invoice-total-rounding` |
38
+ | `chore` | Maintenance, dependencies, tooling | `chore/upgrade-next` |
39
+
40
+ ## Examples
41
+
42
+ ```text
43
+ ✅ Good
44
+ feat/hero-question-rail
45
+ fix/checkout-total-rounding
46
+ chore/upgrade-tailwind
47
+
48
+ ❌ Bad
49
+ hero # No type, and too vague
50
+ feature/HeroQuestionRail # Not a standard type, and not kebab-case
51
+ fix/btn # Shorthand
52
+ toms-branch # Says nothing about the work
53
+ feat/invoices-and-login-fix # Two pieces of work
54
+ ```
55
+
56
+ ## Ticket numbers
57
+
58
+ When the work has a ticket, put the ticket number after the type:
59
+
60
+ ```text
61
+ feat/ACT-142-invoice-export
62
+ ```
63
+
64
+ ## AI agents
65
+
66
+ AI agents **never commit code**, so they do not create branches to commit to either. A person creates the branch, reviews the agent's changes, and commits them. See [AGENTS.md](/Standards/agent-specs#agents-never-commit-code).
@@ -0,0 +1,189 @@
1
+ ---
2
+ sidebar_position: 6
3
+ ---
4
+
5
+ # Conventional Commits
6
+
7
+ All Activatus repositories follow the [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) specification for commit messages. This gives us machine-readable history, automatic changelogs, and a shared vocabulary for what a commit does.
8
+
9
+ ## Format
10
+
11
+ ```text
12
+ <type>(<scope>): <description>
13
+
14
+ [optional body]
15
+
16
+ [optional footer(s)]
17
+ ```
18
+
19
+ The first line (header) must not exceed **72 characters**. Everything else is optional.
20
+
21
+ ## Quick examples
22
+
23
+ ```text
24
+ feat(authentication): add magic-link login flow
25
+ fix(api): handle null response from payment provider
26
+ docs: clarify AGENTS.md authoring guide
27
+ refactor(ui): extract Button into shared component library
28
+ chore(deps): bump eslint-config to v0.2.0
29
+ feat!: drop support for Node 18
30
+ ```
31
+
32
+ ## Type reference
33
+
34
+ | Type | When to use |
35
+ | --- | --- |
36
+ | `feat` | A new feature visible to users or API consumers |
37
+ | `fix` | A bug fix |
38
+ | `docs` | Documentation changes only |
39
+ | `style` | Formatting or whitespace — no logic change |
40
+ | `refactor` | Code restructuring with no feature or bug change |
41
+ | `perf` | A performance improvement |
42
+ | `test` | Adding or correcting tests |
43
+ | `build` | Build system or dependency changes |
44
+ | `ci` | CI/CD pipeline changes |
45
+ | `chore` | Maintenance that doesn't fit elsewhere |
46
+ | `revert` | Reverts a previous commit |
47
+
48
+ ## Scope
49
+
50
+ The scope is optional and goes in parentheses after the type. It names the part of the codebase the commit touches:
51
+
52
+ ```text
53
+ feat(authentication): ...
54
+ fix(checkout): ...
55
+ refactor(ui/button): ...
56
+ ```
57
+
58
+ Use lowercase, kebab-case names. If a commit spans many areas, omit the scope rather than writing a vague one.
59
+
60
+ ## Description
61
+
62
+ - Imperative, present tense: **"add"** not "added" or "adds"
63
+ - No capital letter at the start
64
+ - No period at the end
65
+ - Describes *what* the commit does, not *how*
66
+
67
+ ```text
68
+ ✓ feat: add dark mode toggle
69
+ ✗ feat: Added dark mode toggle.
70
+ ✗ feat: dark mode
71
+ ```
72
+
73
+ ## Body
74
+
75
+ The body explains the *why* behind a change — context that won't be obvious from the diff. Wrap at 72 characters.
76
+
77
+ ```text
78
+ fix(api): retry on transient 503 from payments provider
79
+
80
+ The payments API returns a 503 during brief maintenance windows.
81
+ Previously this caused checkout to fail immediately. Now we retry
82
+ up to 3 times with exponential back-off before surfacing an error.
83
+ ```
84
+
85
+ ## Breaking changes
86
+
87
+ Signal a breaking change in one of two ways:
88
+
89
+ **Inline `!` after the type** (for the header only):
90
+
91
+ ```text
92
+ feat!: remove deprecated /v1/users endpoint
93
+ ```
94
+
95
+ **`BREAKING CHANGE:` footer** (required when a body explains the break):
96
+
97
+ ```text
98
+ feat(api)!: require explicit content-type header on all requests
99
+
100
+ BREAKING CHANGE: requests without a Content-Type header now return
101
+ 400. Previously the API defaulted to application/json.
102
+ ```
103
+
104
+ A breaking change bumps the **major** version in SemVer (`1.0.0` → `2.0.0`).
105
+
106
+ ## Versioning implications
107
+
108
+ When using [Changesets](https://github.com/changesets/changesets) or a changelog tool that understands Conventional Commits:
109
+
110
+ | Commit type | SemVer bump |
111
+ | --- | --- |
112
+ | `fix`, `perf` | patch (`1.0.0` → `1.0.1`) |
113
+ | `feat` | minor (`1.0.0` → `1.1.0`) |
114
+ | Any with `!` or `BREAKING CHANGE` | major (`1.0.0` → `2.0.0`) |
115
+ | All others (`docs`, `chore`, `ci`, …) | none |
116
+
117
+ ## Multi-commit PRs
118
+
119
+ Each commit in a PR should be independently meaningful and deployable. Prefer:
120
+
121
+ ```text
122
+ feat(authentication): scaffold magic-link token model
123
+ feat(authentication): add magic-link send endpoint
124
+ feat(authentication): add magic-link verify endpoint
125
+ test(authentication): add integration tests for magic-link flow
126
+ docs(authentication): document magic-link API in AGENTS.md
127
+ ```
128
+
129
+ Over a single `feat(authentication): implement magic-link` that touches everything at once. Granular commits make `git bisect` and revert effective.
130
+
131
+ ## People commit, not AI agents
132
+
133
+ Commits are made by people. [AI agents never commit code](/Standards/agent-specs#agents-never-commit-code) — an agent leaves its changes uncommitted, and a person reviews them and writes the commit.
134
+
135
+ Branches follow the [Branch Naming](/Standards/branch-naming) standard.
136
+
137
+ ## Enforcing commit messages
138
+
139
+ Every project uses [Commitlint](https://commitlint.io) with a [Husky](https://typicode.github.io/husky/) git hook, so a commit with a badly formatted message is refused. **Set up both — the config file on its own enforces nothing.**
140
+
141
+ ### Setup
142
+
143
+ 1. Install the packages:
144
+
145
+ ```bash
146
+ pnpm add -D @commitlint/cli @commitlint/config-conventional husky
147
+ ```
148
+
149
+ 2. Add the `prepare` script to `package.json`, so the hooks are installed whenever someone runs `pnpm install`:
150
+
151
+ ```json
152
+ {
153
+ "scripts": {
154
+ "prepare": "husky"
155
+ }
156
+ }
157
+ ```
158
+
159
+ 3. Add [`.commitlintrc.json`](/templates#commitlint) to the project root.
160
+
161
+ 4. Add the hook file [`.husky/commit-msg`](/templates#husky):
162
+
163
+ ```text title=".husky/commit-msg"
164
+ pnpm exec commitlint --edit "$1"
165
+ ```
166
+
167
+ 5. Run `pnpm install` once to activate the hook.
168
+
169
+ After that, every commit runs the `commit-msg` hook.
170
+
171
+ ### Lint before every commit
172
+
173
+ Add a second hook, [`.husky/pre-commit`](/templates#husky), so code that breaks the standards cannot be committed:
174
+
175
+ ```text title=".husky/pre-commit"
176
+ pnpm lint
177
+ ```
178
+
179
+ If `pnpm lint` reports an error, the commit is refused. See [Fixing Lint Errors](/Standards/lint-errors).
180
+
181
+ ### Configuration
182
+
183
+ The configuration is in `.commitlintrc.json`:
184
+
185
+ ```json
186
+ {
187
+ "extends": ["@commitlint/config-conventional"]
188
+ }
189
+ ```