Skip to content

Commit c8efcc6

Browse files
Add repository-wide DevDocs quality rules and local reference ignore.
Introduce always-on systematic documentation quality gates with hook-specific safeguards, and ignore local .reference mirrors to keep repository history clean. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3e24a36 commit c8efcc6

4 files changed

Lines changed: 114 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
description: Hook reference metadata and call example quality rules
3+
globs: modules/concepts/hooks/list-of-hooks/*.md
4+
alwaysApply: false
5+
---
6+
7+
# Hook Reference Quality
8+
9+
Use this when editing generated or manually corrected hook reference pages.
10+
11+
## Metadata Rules
12+
13+
- `files[].url` must point to an existing source file in the correct repository.
14+
- Core links use `PrestaShop/PrestaShop` target branch.
15+
- Theme links use `classic-theme` or `hummingbird`, not `PrestaShop/PrestaShop/themes/...`.
16+
- Module links use native module repositories, not `PrestaShop/PrestaShop/modules/...`.
17+
- Do not use `files: {}` when a reviewer or source code identifies a real origin.
18+
- Delete pages for hooks that no longer dispatch in the target branch.
19+
20+
## Call Example Rules
21+
22+
- The call block must show the actual hook invocation, not adjacent code.
23+
- Include the full current parameter array, including `id_shop`, `chain`, by-reference values, and return flags when present.
24+
- Do not keep truncated fragments like only the hook name or first array keys.
25+
- Use `twig` fences for `renderhook(...)` and `php` fences for `Hook::exec(...)`.
26+
- Remove copied constants, comments, copyright headers, `include(...)`, layout markup, and unrelated code.
27+
- Smarty `{hook ...}` snippets must not end with `;`.
28+
29+
## Systemic Checks
30+
31+
- Search all changed hook pages for the same pattern after fixing one comment.
32+
- Verify deleted/empty-source candidates with source search, not only `hook.xml`.
33+
- Treat allow-list constants as references, not proof that a hook is dispatched.
34+
- Re-run hook validation, source-link checks, and Hugo build before push.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
description: Hugo Markdown formatting guardrails for DevDocs pages
3+
globs: "**/*.md"
4+
alwaysApply: false
5+
---
6+
7+
# PrestaShop DevDocs - Hugo Markdown
8+
9+
Use this companion rule for markdown formatting only. Repository-wide quality gates are defined in `devdocs-systematic-quality-gates.mdc` (always on).
10+
11+
This repository is Hugo content using [Goldmark](https://github.com/yuin/goldmark). Follow existing file patterns and avoid generic markdown reformatting.
12+
13+
## Front matter
14+
15+
- Keep YAML front matter between `---` markers.
16+
- Do not add or remove fields unless explicitly requested.
17+
- Do not rewrite YAML indentation/order for style only.
18+
19+
## Hugo shortcodes
20+
21+
- Keep shortcode syntax unchanged: `{{< ... >}}`, `{{% ... %}}`, `relref`/`ref`.
22+
- Do not rename shortcodes or alter bracket style without task requirements.
23+
- Keep internal links in repository style; use plain markdown for external URLs.
24+
25+
## Do Not Auto-Refactor
26+
27+
- Do not insert extra spaces in links.
28+
- Do not remove intentional trailing spaces used for markdown line breaks.
29+
- Do not switch list markers (`*` vs `-`) for style only.
30+
- Do not add/remove blank lines without semantic reason.
31+
- Do not change fenced code block language tags or delimiters unless requested.
32+
33+
## Repository References
34+
35+
- [Writing Markdown](contribute/documentation/how/writing-markdown.md)
36+
- [Shortcodes index](contribute/documentation/shortcodes/_index.md)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
description: Repository-wide quality gates for PrestaShop DevDocs changes
3+
alwaysApply: true
4+
---
5+
6+
# PrestaShop DevDocs: Systematic Quality
7+
8+
Apply this to every docs area: hooks, Admin API, modules, themes, webservice, basics, contribution guides, and all version branches.
9+
10+
## Work Systemically
11+
12+
- Treat review comments and maintainer follow-up commits as examples of a class of issue.
13+
- Audit the full changed scope for similar issues before editing.
14+
- For version migrations, verify behavior against the target branch, not previous docs.
15+
- Prefer deleting obsolete pages over preserving stale documentation.
16+
17+
## Source of Truth
18+
19+
- Core behavior: target `PrestaShop/PrestaShop` branch.
20+
- Theme behavior: `classic-theme` and `hummingbird`.
21+
- Module behavior: official native module repositories.
22+
- Existing docs are not authoritative when source code disagrees.
23+
24+
## Content Accuracy
25+
26+
- Examples must be current, minimal, and copied from real source behavior.
27+
- Do not include unrelated surrounding code, constants, comments, or half-copied arrays.
28+
- Code fence language must match the snippet syntax.
29+
- Parameter arrays must be complete for the current call, including references and flags.
30+
- Never leave placeholders, partial links, or known-broken URLs.
31+
32+
## Verification Before Push
33+
34+
- Run area-specific validators and a CI-equivalent Hugo build.
35+
- Check changed links and examples against source.
36+
- Do not push until validation passes.
37+
38+
## Continuous Improvement
39+
40+
When a new failure pattern is discovered:
41+
- Add it to the relevant rule.
42+
- Add or improve a deterministic local check when possible.
43+
- Re-run the full-scope audit to prove no similar cases remain.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea/
22
.claude/
3+
.reference/

0 commit comments

Comments
 (0)