@aigis-ai/cli 1.0.3 → 2.0.1
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/CONTRIBUTING.md +53 -0
- package/SKILL.md +20 -55
- package/bin/aigis.js +446 -59
- package/cli-python/LICENSE +21 -0
- package/cli-python/README.md +32 -0
- package/cli-python/aigis_cli/SKILL.md +70 -0
- package/cli-python/aigis_cli/__init__.py +3 -0
- package/cli-python/aigis_cli/__pycache__/__init__.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/annotate.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/build.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/checksum.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/classify.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/cli.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/fetch.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/init_ide.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/keywords.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/__pycache__/search.cpython-313.pyc +0 -0
- package/cli-python/aigis_cli/annotate.py +45 -0
- package/cli-python/aigis_cli/auto_verify.py +518 -0
- package/cli-python/aigis_cli/build.py +470 -0
- package/cli-python/aigis_cli/checksum.py +22 -0
- package/cli-python/aigis_cli/classify.py +192 -0
- package/cli-python/aigis_cli/cli.py +618 -0
- package/cli-python/aigis_cli/content/index/audit-scan.md +217 -0
- package/cli-python/aigis_cli/content/index/auto-verify-rules.json +439 -0
- package/cli-python/aigis_cli/content/index/context-rules.json +90 -0
- package/cli-python/aigis_cli/content/index/frameworks.md +82 -0
- package/cli-python/aigis_cli/content/index/guardrails.json +23 -0
- package/cli-python/aigis_cli/content/index/taxonomy.md +81 -0
- package/cli-python/aigis_cli/content/resolvers/triggers.json +229 -0
- package/{content/implement → cli-python/aigis_cli/content/skills/areas}/audit-logging.md +5 -0
- package/cli-python/aigis_cli/content/skills/areas/fallback-patterns.md +200 -0
- package/cli-python/aigis_cli/content/skills/areas/input-validation.md +380 -0
- package/cli-python/aigis_cli/content/skills/areas/pii-handling.md +189 -0
- package/cli-python/aigis_cli/content/skills/areas/rate-limiting.md +246 -0
- package/cli-python/aigis_cli/content/skills/core.md +62 -0
- package/cli-python/aigis_cli/content/skills/infrastructure/logging.md +202 -0
- package/cli-python/aigis_cli/content/skills/infrastructure/rate-limiting.md +169 -0
- package/cli-python/aigis_cli/content/skills/infrastructure/secrets.md +167 -0
- package/cli-python/aigis_cli/content/skills/workflows/fastapi-llm.md +86 -0
- package/cli-python/aigis_cli/content/templates/ai-impact-assessment.md +54 -0
- package/cli-python/aigis_cli/content/templates/intended-purpose-doc.md +39 -0
- package/cli-python/aigis_cli/content/templates/risk-characterization.md +34 -0
- package/cli-python/aigis_cli/content/templates/third-party-assessment.md +41 -0
- package/cli-python/aigis_cli/content/verify/checklist-audit-logging.md +13 -0
- package/cli-python/aigis_cli/content/verify/checklist-bias-monitoring.md +13 -0
- package/cli-python/aigis_cli/content/verify/checklist-confidence-scoring.md +13 -0
- package/cli-python/aigis_cli/content/verify/checklist-data-integrity.md +12 -0
- package/cli-python/aigis_cli/content/verify/checklist-explainability.md +13 -0
- package/cli-python/aigis_cli/content/verify/checklist-fallback-patterns.md +13 -0
- package/cli-python/aigis_cli/content/verify/checklist-human-oversight.md +14 -0
- package/cli-python/aigis_cli/content/verify/checklist-input-validation.md +16 -0
- package/cli-python/aigis_cli/content/verify/checklist-monitoring.md +13 -0
- package/cli-python/aigis_cli/content/verify/checklist-output-sanitization.md +14 -0
- package/cli-python/aigis_cli/content/verify/checklist-pii-handling.md +14 -0
- package/cli-python/aigis_cli/content/verify/checklist-prompt-security.md +13 -0
- package/cli-python/aigis_cli/content/verify/checklist-rag-security.md +12 -0
- package/cli-python/aigis_cli/content/verify/checklist-rate-limiting.md +13 -0
- package/cli-python/aigis_cli/content/verify/checklist-supply-chain.md +13 -0
- package/cli-python/aigis_cli/fetch.py +232 -0
- package/cli-python/aigis_cli/init_ide.py +159 -0
- package/cli-python/aigis_cli/keywords.py +73 -0
- package/cli-python/aigis_cli/search.py +69 -0
- package/cli-python/aigis_cli.egg-info/PKG-INFO +59 -0
- package/cli-python/aigis_cli.egg-info/SOURCES.txt +56 -0
- package/cli-python/aigis_cli.egg-info/dependency_links.txt +1 -0
- package/cli-python/aigis_cli.egg-info/entry_points.txt +2 -0
- package/cli-python/aigis_cli.egg-info/requires.txt +6 -0
- package/cli-python/aigis_cli.egg-info/top_level.txt +1 -0
- package/cli-python/dist/aigis_cli-1.0.3-py3-none-any.whl +0 -0
- package/cli-python/dist/aigis_cli-1.0.3.tar.gz +0 -0
- package/cli-python/pyproject.toml +49 -0
- package/content/index/audit-scan.md +21 -207
- package/content/index/auto-verify-rules.json +439 -0
- package/content/index/context-rules.json +90 -0
- package/content/resolvers/triggers.json +229 -0
- package/content/skills/areas/audit-logging.md +176 -0
- package/content/skills/areas/bias-monitoring.md +172 -0
- package/content/skills/areas/confidence-scoring.md +180 -0
- package/content/skills/areas/data-integrity.md +257 -0
- package/content/skills/areas/explainability.md +174 -0
- package/content/skills/areas/fallback-patterns.md +200 -0
- package/content/skills/areas/human-oversight.md +220 -0
- package/content/skills/areas/input-validation.md +380 -0
- package/content/skills/areas/monitoring.md +207 -0
- package/content/skills/areas/output-sanitization.md +183 -0
- package/content/skills/areas/pii-handling.md +189 -0
- package/content/skills/areas/prompt-security.md +153 -0
- package/content/skills/areas/rag-security.md +230 -0
- package/content/skills/areas/rate-limiting.md +246 -0
- package/content/skills/areas/supply-chain.md +193 -0
- package/content/skills/core.md +62 -0
- package/content/skills/infrastructure/logging.md +202 -0
- package/content/skills/infrastructure/rate-limiting.md +169 -0
- package/content/skills/infrastructure/secrets.md +167 -0
- package/content/skills/workflows/fastapi-llm.md +86 -0
- package/docs/resolvers.md +114 -0
- package/lib/auto-verify.js +378 -0
- package/lib/build.js +629 -0
- package/lib/checksum.js +39 -0
- package/lib/fetch.js +164 -9
- package/lib/init.js +141 -93
- package/lib/keywords.js +92 -130
- package/lib/special-recognizers.js +370 -0
- package/package.json +1 -1
- package/scripts/baseline-cursorrules.snapshot.txt +30 -0
- package/scripts/bootstrap-step-6-bench.js +85 -0
- package/scripts/check-content-sync.js +91 -0
- package/scripts/triggers.schema.json +50 -0
- package/scripts/validate-triggers.js +176 -0
- package/content/implement/fallback-patterns.md +0 -190
- package/content/implement/input-validation.md +0 -212
- package/content/implement/pii-handling.md +0 -207
- package/content/implement/rate-limiting.md +0 -217
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/bias-monitoring.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/confidence-scoring.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/data-integrity.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/explainability.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/human-oversight.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/monitoring.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/output-sanitization.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/prompt-security.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/rag-security.md +0 -0
- /package/{content/implement → cli-python/aigis_cli/content/skills/areas}/supply-chain.md +0 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Contributing to Aigis
|
|
2
|
+
|
|
3
|
+
Thanks for your interest in contributing. This guide is short on purpose — most contributions follow one of a few well-trodden paths.
|
|
4
|
+
|
|
5
|
+
## Where to put what
|
|
6
|
+
|
|
7
|
+
- **Governance pattern content** (the procedures agents follow): `content/skills/areas/<id>.md`
|
|
8
|
+
- **Workflow scaffolding** (canonical file layouts per project type): `content/skills/workflows/<type>.md`
|
|
9
|
+
- **Trigger mappings** (natural-language → trait): `content/resolvers/triggers.json` — see [Trigger mappings](#trigger-mappings) below.
|
|
10
|
+
- **Verification checklists** (used by `aigis verify`): `content/verify/checklist-<id>.md`
|
|
11
|
+
- **Auto-verify rules** (deterministic scanner patterns): `content/index/auto-verify-rules.json`
|
|
12
|
+
- **CLI behavior**: `bin/aigis.js` and `lib/*.js`
|
|
13
|
+
|
|
14
|
+
## Trigger mappings
|
|
15
|
+
|
|
16
|
+
To add or modify entries in `content/resolvers/triggers.json`:
|
|
17
|
+
|
|
18
|
+
1. Read [`docs/resolvers.md`](docs/resolvers.md) — the tier rule and curation policy.
|
|
19
|
+
2. Pick a tier per the decision rule. When in doubt, low-confidence.
|
|
20
|
+
3. Insert the entry alphabetically within the appropriate tier (case-insensitive sort).
|
|
21
|
+
4. Run validation locally: `node scripts/validate-triggers.js`
|
|
22
|
+
5. Open a PR using `.github/PULL_REQUEST_TEMPLATE/trigger_mapping.md`.
|
|
23
|
+
|
|
24
|
+
**The use-case requirement is non-negotiable.** Every trigger PR includes a one-sentence real use case (`"I'm building X and I needed this trigger because Y."`). PRs without a real use case are closed. We curate based on actual demand, not theoretical taxonomy completeness.
|
|
25
|
+
|
|
26
|
+
The PR template enforces structure; CI runs four validations on the JSON via `.github/workflows/triggers-validation.yml`.
|
|
27
|
+
|
|
28
|
+
## CLI / library changes
|
|
29
|
+
|
|
30
|
+
- Add CLI-deterministic tests next to the change. Where existing tests exist (e.g., `test/checksum-determinism.test.js`), follow their pattern.
|
|
31
|
+
- Backward compatibility: not promised across alpha releases. After v2.0 final ships, breaking changes go through a deprecation notice and a major version bump.
|
|
32
|
+
- Python CLI mirrors the JS CLI structurally (see `cli-python/aigis_cli/`). Functional parity is best-effort; JS is the primary runtime for the v2.0 benchmark.
|
|
33
|
+
|
|
34
|
+
## Running aigis from this checkout
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
git clone <repo>
|
|
38
|
+
cd aigis-cli
|
|
39
|
+
npm install
|
|
40
|
+
npm link # makes the in-repo build the global `aigis`
|
|
41
|
+
aigis --version # confirms you're on the branch's version
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
To restore the published version: `npm unlink -g @aigis-ai/cli && npm install -g @aigis-ai/cli`.
|
|
45
|
+
|
|
46
|
+
## Tests
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
node scripts/validate-triggers.js # JSON validation (schema, traits, prompts, ordering)
|
|
50
|
+
node test/checksum-determinism.test.js # checksum reproducibility
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
(Test runner is the standard Node test runner via the `test:` script in `package.json`. We do not use a heavyweight test framework.)
|
package/SKILL.md
CHANGED
|
@@ -1,70 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: aigis
|
|
3
|
-
description: AI governance
|
|
3
|
+
description: AI governance for coding agents. Three-layer skill system — core / area / workflow. Use the aigis CLI to load skills on demand. Mapped to NIST AI RMF, OWASP Top 10 for LLMs, and ISO/IEC 42001.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Aigis
|
|
6
|
+
# Aigis skill system
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Aigis ships skills in three layers. Agents load them on demand via the CLI, not by reading this file.
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
1. aigis classify --traits <relevant-traits> --json
|
|
12
|
-
2. For EACH file in the implement_files list, one at a time:
|
|
13
|
-
a. aigis get <file-id>
|
|
14
|
-
b. Implement the patterns in the code
|
|
15
|
-
c. aigis verify <file-id>
|
|
16
|
-
d. Fix any FAIL or PARTIAL items until all checks pass
|
|
17
|
-
e. Move to the next file
|
|
18
|
-
3. After all files pass, generate required templates:
|
|
19
|
-
aigis template <template-id>
|
|
10
|
+
## Layers
|
|
20
11
|
|
|
21
|
-
|
|
12
|
+
- **Core skill** — `content/skills/core.md`. Always loaded into the agent's context by `aigis init <ide>`. Orients the agent to the workflow + the four CLI commands. ~50 lines.
|
|
13
|
+
- **Area skills** — `content/skills/areas/<id>.md`, one per governance area (input-validation, pii-handling, etc.). 15 today. Loaded by `aigis get <id>` when classify points the agent at that area.
|
|
14
|
+
- **Workflow skills** — `content/skills/workflows/<type>.md`. Loaded by `aigis workflow <type>` after classify identifies the project shape. Step 5 ships `fastapi-llm`; future workflows: `express-llm`, `nextjs-llm`, `agentic`, `rag-service`.
|
|
22
15
|
|
|
23
|
-
##
|
|
24
|
-
\`\`\`bash
|
|
25
|
-
# 1. Get the structured audit scan prompt
|
|
26
|
-
aigis audit --scan
|
|
16
|
+
## How an agent uses Aigis
|
|
27
17
|
|
|
28
|
-
|
|
18
|
+
After `aigis init` writes the core skill into the agent's rules file, the agent runs:
|
|
29
19
|
|
|
30
|
-
|
|
31
|
-
aigis
|
|
20
|
+
1. `aigis classify` — get risk tier + recommended areas + workflow suggestion
|
|
21
|
+
2. `aigis workflow <type>` — get the canonical file layout + wiring contracts
|
|
22
|
+
3. `aigis get <area>` and `aigis verify <area> --auto .` per area, in order
|
|
32
23
|
|
|
33
|
-
|
|
34
|
-
\`\`\`
|
|
24
|
+
See `content/skills/core.md` for the full prose version that the agent sees.
|
|
35
25
|
|
|
36
|
-
##
|
|
37
|
-
- Before writing any LLM API call or AI feature (new code)
|
|
38
|
-
- When auditing an existing AI system for governance gaps (existing code)
|
|
39
|
-
- Before processing any sensitive data through an AI system
|
|
40
|
-
- Before deploying any AI feature to production
|
|
41
|
-
- When onboarding to a new AI project to understand what controls exist
|
|
26
|
+
## Setup per IDE
|
|
42
27
|
|
|
43
|
-
|
|
44
|
-
- \`aigis classify --traits <comma-separated>\` — get risk tier and relevant files
|
|
45
|
-
- \`aigis classify "<description>"\` — same, using natural language (keyword matching)
|
|
46
|
-
- \`aigis get <file-id> [file-id...]\` — fetch implementation patterns (one or more)
|
|
47
|
-
- \`aigis get <file-id> --lang py|js\` — fetch filtered to one language
|
|
48
|
-
- \`aigis verify <file-id> [file-id...]\` — fetch verification checklists
|
|
49
|
-
- \`aigis template <template-id> [template-id...]\` — fetch compliance documentation templates
|
|
50
|
-
- \`aigis audit --scan\` — get structured audit prompt for scanning existing codebases
|
|
51
|
-
- \`aigis audit --traits <comma-separated>\` — get bundled classification + all checklists for audit
|
|
52
|
-
- \`aigis search <query>\` — search across all content by keyword or control ID
|
|
53
|
-
- \`aigis search --list\` — list all available files
|
|
54
|
-
- \`aigis annotate <file-id> "<note>"\` — attach a local note for future sessions
|
|
55
|
-
- \`aigis annotate --list\` — list all annotations
|
|
56
|
-
- \`aigis init cursor|claude-code|windsurf|copilot\` — set up aigis for your IDE
|
|
28
|
+
Run once in the project root:
|
|
57
29
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Output type: generates-code, generates-content, multi-model-pipeline
|
|
63
|
-
Jurisdiction: jurisdiction-eu, jurisdiction-us-regulated, jurisdiction-global
|
|
30
|
+
- `aigis init cursor` — writes `.cursorrules`
|
|
31
|
+
- `aigis init claude-code` — writes `~/.claude/skills/aigis/SKILL.md`
|
|
32
|
+
- `aigis init windsurf` — writes `.windsurfrules`
|
|
33
|
+
- `aigis init copilot` — writes `.github/copilot-instructions.md`
|
|
64
34
|
|
|
65
|
-
|
|
66
|
-
- Claude Code: place this file in ~/.claude/skills/aigis/SKILL.md
|
|
67
|
-
- Cursor: run \`aigis init cursor\` in your project root
|
|
68
|
-
- Windsurf: run \`aigis init windsurf\` in your project root
|
|
69
|
-
- GitHub Copilot: run \`aigis init copilot\` in your project root
|
|
70
|
-
- Any agent: include aigis usage instructions in system prompt
|
|
35
|
+
All four destinations receive the same content: `content/skills/core.md`. Area and workflow skills load on demand; they are not pre-installed into the rules file.
|