refactor: format markdown files using prettier, fix spelling concerns, reduce Taskfile bloat
This commit is contained in:
608 files changed
+63317
-10219
No files matched your search
@@ -1,16 +1,17 @@
|
||||
---
|
||||
|
||||
name: archie-wf-frontend
|
||||
description: >
|
||||
Runs frontend quality checks: stylelint for CSS, htmlhint for HTML.
|
||||
Gate stage runs these after Go vet/build/test. Use in any project
|
||||
with web assets to catch syntax errors, broken selectors, and
|
||||
structural issues before they reach a PR.
|
||||
Runs frontend quality checks: stylelint for CSS, htmlhint for HTML.
|
||||
Gate stage runs these after Go vet/build/test. Use in any project
|
||||
with web assets to catch syntax errors, broken selectors, and
|
||||
structural issues before they reach a PR.
|
||||
version: 1.1.0
|
||||
metadata:
|
||||
archie:
|
||||
workflow: frontend
|
||||
tools: [stylelint, htmlhint]
|
||||
engine: any
|
||||
archie:
|
||||
workflow: frontend
|
||||
tools: [stylelint, htmlhint]
|
||||
engine: any
|
||||
|
||||
# Frontend Quality Gate
|
||||
|
||||
@@ -19,9 +20,9 @@ metadata:
|
||||
This skill adds frontend linting to the gate stage. After Go checks pass,
|
||||
the gate runs:
|
||||
|
||||
1. `stylelint "**/*.css"` -- catches syntax errors, invalid properties,
|
||||
1. `stylelint "**/*.css"` -- catches syntax errors, invalid properties,
|
||||
duplicate selectors, calc() misuse, missing units
|
||||
2. `htmlhint "**/*.html"` -- catches unclosed tags, mismatched pairs,
|
||||
2. `htmlhint "**/*.html"` -- catches unclosed tags, mismatched pairs,
|
||||
duplicate IDs, inline style abuse, missing viewport meta
|
||||
|
||||
Both must exit 0. If either fails, the stage parks with the lint output.
|
||||
@@ -38,6 +39,5 @@ Both must exit 0. If either fails, the stage parks with the lint output.
|
||||
["htmlhint", "**/*.html"],
|
||||
]
|
||||
```
|
||||
3. Or declare `workflow: frontend` in the skill frontmatter -- archie-core
|
||||
3. Or declare `workflow: frontend` in the skill frontmatter -- archie-core
|
||||
loads the skill body and the agent knows to run these during build
|
||||
|
||||
@@ -10,6 +10,7 @@ metadata:
|
||||
tools: [go, golangci-lint, gofumpt, task]
|
||||
engine: any
|
||||
---
|
||||
|
||||
# Go Quality Gate
|
||||
|
||||
## When this runs
|
||||
@@ -20,7 +21,7 @@ what a correct gate looks like and how to diagnose failures.
|
||||
|
||||
## Standard gate
|
||||
|
||||
Run in this exact order. archie-core does NOT run these -- the `ai-sdk/agentloop` gate
|
||||
Run in this exact order. archie-core does NOT run these -- the `ai-sdk/agentloop` gate
|
||||
does. This list is what you should configure in `config.toml`:
|
||||
|
||||
```toml
|
||||
@@ -42,29 +43,36 @@ TDD workflow inverts only that last command during the repro stage.
|
||||
## Diagnosing gate failures
|
||||
|
||||
### gofumpt / go fix
|
||||
|
||||
These mutate files. If they change anything, the next `git diff` will catch it.
|
||||
The agent should re-run them after making changes.
|
||||
|
||||
### golangci-lint
|
||||
|
||||
Common failures and fixes:
|
||||
- `unused` -- remove the unused function or add `//nolint:unused`
|
||||
- `errcheck` -- handle the error or assign to `_`
|
||||
- `gosec` -- review the security finding; never blindly suppress
|
||||
|
||||
- `unused` -- remove the unused function or add `//nolint:unused`
|
||||
- `errcheck` -- handle the error or assign to `_`
|
||||
- `gosec` -- review the security finding; never blindly suppress
|
||||
|
||||
### go test -race
|
||||
|
||||
Data races are non-deterministic. If `-race` fails:
|
||||
|
||||
1. Identify the race with `go test -race -run=TestName`
|
||||
2. Add a mutex or channel to protect the shared state
|
||||
3. Re-run with `-count=5` to confirm it's gone
|
||||
|
||||
### task deadcode
|
||||
|
||||
Scoping rule: if deadcode fails on packages you didn't touch, scope it:
|
||||
|
||||
```bash
|
||||
golangci-lint run --tests=false --enable-only=unused,staticcheck ./changed/pkg/...
|
||||
```
|
||||
|
||||
## When the TDD workflow runs
|
||||
|
||||
During `repro-tests`, the test command's expectations are INVERTED -- it must FAIL.
|
||||
During `repro-tests`, the test command's expectations are INVERTED -- it must FAIL.
|
||||
During `fix`, the full gate runs normally and test files are write-protected.
|
||||
The agent cannot modify tests in the fix stage; it must fix the code to make them pass.
|
||||
@@ -9,6 +9,7 @@ metadata:
|
||||
tools: [node, npm, pnpm, vitest, eslint, prettier]
|
||||
engine: any
|
||||
---
|
||||
|
||||
# Node.js / TypeScript Ecosystem Conventions
|
||||
|
||||
## Preflight
|
||||
@@ -48,38 +49,43 @@ or `test_glob = "__tests__/**/*.ts"` for Jest-style test directories.
|
||||
## Package management
|
||||
|
||||
arcie-core detects the lockfile:
|
||||
|
||||
- `pnpm-lock.yaml` → use `pnpm`
|
||||
- `package-lock.json` → use `npm`
|
||||
- `yarn.lock` → use `yarn`
|
||||
|
||||
Install before gate:
|
||||
|
||||
```bash
|
||||
pnpm install --frozen-lockfile
|
||||
```
|
||||
|
||||
## Common tools
|
||||
|
||||
| Tool | Purpose | Config file |
|
||||
|---|---|---|
|
||||
| `eslint` | Linting | `eslint.config.mjs` |
|
||||
| `prettier` | Formatting | `.prettierrc` |
|
||||
| `tsc --noEmit` | Type checking | `tsconfig.json` |
|
||||
| `vitest` | Testing | `vitest.config.ts` |
|
||||
| `jest` | Testing (legacy) | `jest.config.ts` |
|
||||
| Tool | Purpose | Config file |
|
||||
| -------------- | ---------------- | ------------------- |
|
||||
| `eslint` | Linting | `eslint.config.mjs` |
|
||||
| `prettier` | Formatting | `.prettierrc` |
|
||||
| `tsc --noEmit` | Type checking | `tsconfig.json` |
|
||||
| `vitest` | Testing | `vitest.config.ts` |
|
||||
| `jest` | Testing (legacy) | `jest.config.ts` |
|
||||
|
||||
## Common gate failures
|
||||
|
||||
### eslint
|
||||
|
||||
- `no-unused-vars`: remove unused import/variable
|
||||
- `@typescript-eslint/no-explicit-any`: add proper type
|
||||
- Import order: let eslint fix it with `--fix`
|
||||
|
||||
### tsc / typecheck
|
||||
- `TS2345`: type mismatch -- fix the argument or the signature
|
||||
- `TS2339`: property doesn't exist -- check the type definition
|
||||
|
||||
- `TS2345`: type mismatch -- fix the argument or the signature
|
||||
- `TS2339`: property doesn't exist -- check the type definition
|
||||
- `Cannot find module`: check the import path or install the package
|
||||
|
||||
### vitest / jest
|
||||
- Test timeout: the test is hanging -- check async/await, mocks, or network calls
|
||||
- Snapshot mismatch: the output changed -- update the snapshot if the change is intentional
|
||||
|
||||
- Test timeout: the test is hanging -- check async/await, mocks, or network calls
|
||||
- Snapshot mismatch: the output changed -- update the snapshot if the change is intentional
|
||||
- Assertion failure: fix the code, not the test
|
||||
@@ -9,6 +9,7 @@ metadata:
|
||||
tools: [python, pytest, ruff, mypy, pip-audit]
|
||||
engine: any
|
||||
---
|
||||
|
||||
# Python Ecosystem Conventions
|
||||
|
||||
## Preflight
|
||||
@@ -41,6 +42,7 @@ with test files outside the package root.
|
||||
## Package management
|
||||
|
||||
arcie-core assumes:
|
||||
|
||||
- `requirements.txt` or `pyproject.toml` at the repo root
|
||||
- Tests run with `pytest` (the ecosystem default)
|
||||
- Linting with `ruff` (recommended) or `flake8`
|
||||
@@ -50,6 +52,7 @@ arcie-core assumes:
|
||||
## Virtual environment
|
||||
|
||||
Before the gate runs, ensure dependencies are installed:
|
||||
|
||||
```bash
|
||||
python -m venv .venv
|
||||
. .venv/bin/activate
|
||||
@@ -58,6 +61,7 @@ pip install pytest ruff mypy pip-audit
|
||||
```
|
||||
|
||||
For `pyproject.toml` projects:
|
||||
|
||||
```bash
|
||||
pip install -e ".[dev]"
|
||||
```
|
||||
@@ -65,16 +69,19 @@ pip install -e ".[dev]"
|
||||
## Common gate failures
|
||||
|
||||
### ruff
|
||||
- `F401`: unused import -- remove it
|
||||
- `E501`: line too long -- break the line
|
||||
- `I001`: import order -- let ruff fix it with `ruff check --fix`
|
||||
|
||||
- `F401`: unused import -- remove it
|
||||
- `E501`: line too long -- break the line
|
||||
- `I001`: import order -- let ruff fix it with `ruff check --fix`
|
||||
|
||||
### mypy
|
||||
- Missing type annotation on public function -- add it
|
||||
- `Cannot determine type` -- add explicit annotation
|
||||
- Import errors -- check the package is installed in the venv
|
||||
|
||||
- Missing type annotation on public function -- add it
|
||||
- `Cannot determine type` -- add explicit annotation
|
||||
- Import errors -- check the package is installed in the venv
|
||||
|
||||
### pytest
|
||||
- Test discovery failed -- check `__init__.py` files and test naming
|
||||
- Import errors -- verify the package is installed (`pip install -e .`)
|
||||
- Assertion failures -- fix the code, not the test
|
||||
|
||||
- Test discovery failed -- check `__init__.py` files and test naming
|
||||
- Import errors -- verify the package is installed (`pip install -e .`)
|
||||
- Assertion failures -- fix the code, not the test
|
||||
@@ -10,12 +10,14 @@ metadata:
|
||||
tools: [golangci-lint, trivy, gitleaks]
|
||||
engine: any
|
||||
---
|
||||
|
||||
# Security Audit
|
||||
|
||||
## When to use
|
||||
|
||||
Run this audit when:
|
||||
- A PR touches authentication, authorization, or session code
|
||||
|
||||
- A PR touches authentication, authorisation, or session code
|
||||
- New API endpoints are added
|
||||
- Database queries or file I/O paths change
|
||||
- The issue mentions "security", "vulnerability", "CVE", or "auth"
|
||||
@@ -24,7 +26,9 @@ Run this audit when:
|
||||
## What to check
|
||||
|
||||
### 1. Hardcoded secrets
|
||||
|
||||
Scan for:
|
||||
|
||||
- API keys, tokens, passwords in source files
|
||||
- `.env` files committed to the repo
|
||||
- Credentials in test fixtures
|
||||
@@ -32,23 +36,28 @@ Scan for:
|
||||
Use `gitleaks detect --no-git` for a fast scan.
|
||||
|
||||
### 2. Injection vectors
|
||||
- **SQL:** any string concatenation in query building. Use parameterized queries.
|
||||
|
||||
- **SQL:** any string concatenation in query building. Use parameterised queries.
|
||||
- **Command:** any `os/exec` with user-controlled input. Use `exec.Command` with separate args, never `sh -c`.
|
||||
- **Path:** any file path constructed from user input without validation. Use `filepath.Clean` and check the resolved path is within the expected directory.
|
||||
|
||||
### 3. Unsafe deserialization
|
||||
|
||||
- `json.Unmarshal` on untrusted input into `interface{}` or `map[string]any` without validation
|
||||
- `yaml.Unmarshal` without `KnownFields` or strict mode
|
||||
- `gob.Decode` on network input
|
||||
|
||||
### 4. Missing auth checks
|
||||
|
||||
- New endpoints without middleware
|
||||
- Internal/admin endpoints exposed without auth
|
||||
- Token validation that only checks signature, not expiry or revocation
|
||||
|
||||
### 5. Dependency CVEs
|
||||
|
||||
Run `trivy fs --severity HIGH,CRITICAL .` on the repository.
|
||||
Report each finding with:
|
||||
|
||||
- Package name and version
|
||||
- CVE ID
|
||||
- CVSS score
|
||||
@@ -57,6 +66,7 @@ Report each finding with:
|
||||
## Reporting
|
||||
|
||||
For each finding, report:
|
||||
|
||||
1. **Severity:** Critical / High / Medium / Low
|
||||
2. **Location:** file, line, function
|
||||
3. **Description:** what's wrong
|
||||
|
||||
@@ -11,6 +11,7 @@ metadata:
|
||||
engine: any
|
||||
workflow: tdd
|
||||
---
|
||||
|
||||
# TDD Bugfix Workflow
|
||||
|
||||
## When this runs
|
||||
@@ -21,15 +22,17 @@ The workflow has five stages: analyse → repro-tests → capture-proof → fix
|
||||
## Stage 1: Analyse (read-only planner)
|
||||
|
||||
The planner agent explores the codebase read-only and produces:
|
||||
|
||||
- Root cause: the exact file, function, and condition
|
||||
- The expected vs actual behaviour
|
||||
- Which test cases would prove the bug exists
|
||||
|
||||
No code is written. The plan is stored but not posted -- the repro proof speaks louder.
|
||||
No code is written. The plan is stored but not posted -- the repro proof speaks louder.
|
||||
|
||||
## Stage 2: Repro Tests (write failing tests only)
|
||||
|
||||
The agent writes tests that PROVE the bug. Critical constraints:
|
||||
|
||||
- **Do not touch non-test files.** Only `*_test.go` (or the ecosystem's test glob).
|
||||
- **The gate is inverted.** The test command (last in `[[repos.gate]]`) must FAIL.
|
||||
If it passes, the repro didn't capture the bug and the stage parks.
|
||||
@@ -44,6 +47,7 @@ the output. This is deterministic proof that the tests fail before the fix.
|
||||
## Stage 4: Fix (code only)
|
||||
|
||||
The agent fixes the bug. Critical constraints:
|
||||
|
||||
- **Test files are write-protected.** The agent CANNOT modify `*_test.go`.
|
||||
This is an environmental constraint, not a prompt rule.
|
||||
- **The full gate runs normally.** All quality commands plus the test suite must pass.
|
||||
@@ -52,6 +56,7 @@ The agent fixes the bug. Critical constraints:
|
||||
## Stage 5: Deliver
|
||||
|
||||
arcie-core:
|
||||
|
||||
1. Commits both the repro and the fix as separate commits (telling the PR story)
|
||||
2. Pushes the branch
|
||||
3. Opens a PR with the builder's summary
|
||||
@@ -60,15 +65,19 @@ arcie-core:
|
||||
## Common pitfalls
|
||||
|
||||
### The repro tests pass unexpectedly
|
||||
|
||||
This means the test doesn't actually capture the bug. Check:
|
||||
|
||||
- Is the test calling the right function with the right inputs?
|
||||
- Is the assertion checking the correct behaviour (not the buggy behaviour)?
|
||||
- Are there test setup issues (missing imports, wrong package)?
|
||||
|
||||
### The fix stage modifies test files
|
||||
This shouldn't happen -- test files are write-protected. If it does, the agent is
|
||||
|
||||
This shouldn't happen -- test files are write-protected. If it does, the agent is
|
||||
bypassing the constraint. The worktree should be inspected.
|
||||
|
||||
### The gate is misconfigured
|
||||
If the repo has no `[[repos.gate]]` entries, TDD cannot run -- it needs at least
|
||||
|
||||
If the repo has no `[[repos.gate]]` entries, TDD cannot run -- it needs at least
|
||||
one gate command, with the test runner last.
|
||||
Reference in new issue
Block a user