ai-core-framework 0.1.0 → 0.2.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 +16 -16
- package/{core/agents → agents}/business-analyst.md +1 -1
- package/{core/agents → agents}/scrum-master.md +7 -3
- package/bin/ai-core-framework.js +4 -4
- package/hooks/hooks-cursor.json +16 -0
- package/hooks/hooks.json +16 -0
- package/hooks/session-start +21 -0
- package/lib/install-codex.js +39 -7
- package/package.json +9 -2
- package/{core/rules → rules}/00-global-rules.md +6 -6
- package/{core/rules → rules}/04-documentation.md +1 -1
- package/{core/scripts → scripts}/ai-core.sh +35 -13
- package/{core/scripts → scripts}/install-codex-prompts.sh +23 -15
- package/{core/scripts → scripts}/log-user-request.sh +3 -3
- package/{core/scripts → scripts}/setup-project.sh +18 -23
- package/{core/scripts → scripts}/sync-platforms.sh +47 -43
- package/{core/scripts → scripts}/validate-audit-log.sh +1 -1
- package/{core/scripts → scripts}/validate-docs.sh +1 -1
- package/{core/scripts → scripts}/validate-permissions.sh +15 -1
- package/{core/scripts → scripts}/validate-state.sh +2 -2
- package/{core/scripts → scripts}/workflow.sh +7 -7
- package/{core/skills → skills}/ai-core-commands/SKILL.md +9 -9
- package/{core/skills → skills}/development-implement-task/SKILL.md +2 -2
- package/{core/skills → skills}/meta-sync-platforms/SKILL.md +5 -5
- package/{core/skills → skills}/meta-validate-audit-log/SKILL.md +1 -1
- package/{core/skills → skills}/meta-validate-docs/SKILL.md +1 -1
- package/{core/skills → skills}/meta-validate-permissions/SKILL.md +2 -2
- package/{core/skills → skills}/meta-validate-state/SKILL.md +2 -2
- package/{core/skills → skills}/planning-analyze-requirements/SKILL.md +3 -3
- package/{core/skills → skills}/planning-mark-ready/SKILL.md +1 -1
- package/{core/skills → skills}/planning-plan-refactor/SKILL.md +3 -3
- package/{core/skills → skills}/project-setup-project/SKILL.md +19 -19
- package/{core/skills → skills}/qa-report-bug/SKILL.md +1 -1
- package/{core/skills → skills}/release-release/SKILL.md +2 -2
- package/{core/skills → skills}/using-ai-core/SKILL.md +2 -3
- package/{core/templates → templates}/ci/ai-core-governance.yml +23 -13
- package/{core/templates → templates}/project/CODEOWNERS +6 -1
- package/templates/project/docs-policy.json +3 -0
- package/{core/templates → templates}/project/project-structure.yaml +11 -11
- package/{core/templates → templates}/qa/bug-report-template.md +1 -1
- package/{core/templates → templates}/requirements/user-story-template.md +1 -1
- package/core/README.md +0 -162
- package/core/templates/project/docs-policy.json +0 -3
- /package/{core/agents → agents}/README.md +0 -0
- /package/{core/agents → agents}/developer.md +0 -0
- /package/{core/agents → agents}/qa-tester.md +0 -0
- /package/{core/agents → agents}/tech-lead.md +0 -0
- /package/{core/config → config}/backlog.schema.json +0 -0
- /package/{core/config → config}/docs-policy.default.json +0 -0
- /package/{core/config → config}/release.schema.json +0 -0
- /package/{core/config → config}/ticket.schema.json +0 -0
- /package/{core/rules → rules}/01-git-workflow.md +0 -0
- /package/{core/rules → rules}/02-code-quality.md +0 -0
- /package/{core/rules → rules}/03-security.md +0 -0
- /package/{core/rules → rules}/05-testing-mandatory.md +0 -0
- /package/{core/rules → rules}/06-approval-gates.md +0 -0
- /package/{core/rules → rules}/07-definition-of-ready.md +0 -0
- /package/{core/rules → rules}/08-definition-of-done.md +0 -0
- /package/{core/scripts → scripts}/generate-views.sh +0 -0
- /package/{core/skills → skills}/README.md +0 -0
- /package/{core/skills → skills}/brainstorming/SKILL.md +0 -0
- /package/{core/skills → skills}/executing-ticket/SKILL.md +0 -0
- /package/{core/skills → skills}/git-branch-status/SKILL.md +0 -0
- /package/{core/skills → skills}/git-cleanup-branches/SKILL.md +0 -0
- /package/{core/skills → skills}/git-scan-untracked/SKILL.md +0 -0
- /package/{core/skills → skills}/meta-generate-views/SKILL.md +0 -0
- /package/{core/skills → skills}/meta-request-log/SKILL.md +0 -0
- /package/{core/skills → skills}/meta-sprint-report/SKILL.md +0 -0
- /package/{core/skills → skills}/meta-ticket-health/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-backlog-status/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-document-existing-requirements/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-estimate-task/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-groom-ticket/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-plan-sprint/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-prioritize-backlog/SKILL.md +0 -0
- /package/{core/skills → skills}/planning-write-plan/SKILL.md +0 -0
- /package/{core/skills → skills}/project-detect-stack/SKILL.md +0 -0
- /package/{core/skills → skills}/project-discover-codebase/SKILL.md +0 -0
- /package/{core/skills → skills}/qa-bug-status/SKILL.md +0 -0
- /package/{core/skills → skills}/qa-smoke-test/SKILL.md +0 -0
- /package/{core/skills → skills}/qa-triage-bug/SKILL.md +0 -0
- /package/{core/skills → skills}/qa-verify-fix/SKILL.md +0 -0
- /package/{core/skills → skills}/release-hotfix/SKILL.md +0 -0
- /package/{core/skills → skills}/release-rollback/SKILL.md +0 -0
- /package/{core/skills → skills}/review-create-pr/SKILL.md +0 -0
- /package/{core/skills → skills}/review-merge-pr/SKILL.md +0 -0
- /package/{core/skills → skills}/review-techlead-review/SKILL.md +0 -0
- /package/{core/skills → skills}/verification-before-done/SKILL.md +0 -0
- /package/{core/skills → skills}/writing-implementation-plan/SKILL.md +0 -0
- /package/{core/templates → templates}/ci/node-pnpm.yml +0 -0
- /package/{core/templates → templates}/pm/retrospective-template.md +0 -0
- /package/{core/templates → templates}/pm/sprint-plan-template.md +0 -0
- /package/{core/templates → templates}/pr/pull-request-template.md +0 -0
- /package/{core/templates → templates}/project/project-config.yaml +0 -0
- /package/{core/templates → templates}/qa/test-plan-template.md +0 -0
- /package/{core/templates → templates}/release/release-record-template.json +0 -0
- /package/{core/templates → templates}/requirements/PRD-template.md +0 -0
- /package/{core/templates → templates}/technical/ADR-template.md +0 -0
- /package/{core/templates → templates}/technical/refactor-plan-template.md +0 -0
- /package/{core/templates → templates}/technical/tech-design-template.md +0 -0
- /package/{core/workflows → workflows}/bug-lifecycle.md +0 -0
- /package/{core/workflows → workflows}/feature-lifecycle.md +0 -0
- /package/{core/workflows → workflows}/hotfix-lifecycle.md +0 -0
- /package/{core/workflows → workflows}/sprint-lifecycle.md +0 -0
package/README.md
CHANGED
|
@@ -8,8 +8,8 @@ npx ai-core-framework
|
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
Run the command from the root of the project that should receive AI Core. The
|
|
11
|
-
installer asks which AI CLI to target. Version 0.1 supports Codex and copies
|
|
12
|
-
|
|
11
|
+
installer asks which AI CLI to target. Version 0.1 supports Codex and copies this
|
|
12
|
+
repo's root-level framework folders directly into the target project's
|
|
13
13
|
`.codex/` directory:
|
|
14
14
|
|
|
15
15
|
```text
|
|
@@ -131,23 +131,23 @@ The framework now includes mechanical gates beyond prompt-level rules:
|
|
|
131
131
|
|
|
132
132
|
- `scripts/validate-state.sh` validates ticket state transitions, backlog rank integrity, dependency ordering, blocked-ticket unblock evidence, DONE-ticket DoD fields, QA evidence, and release governance records.
|
|
133
133
|
- `scripts/validate-docs.sh` validates documentation obligations from diffs and ticket metadata, including API docs, README/setup docs, migration runbooks, ADRs, changelog/release notes, and DONE-ticket documentation evidence.
|
|
134
|
-
- `scripts/validate-permissions.sh` validates state-history command execution against `
|
|
135
|
-
- `
|
|
136
|
-
- `
|
|
137
|
-
- `
|
|
138
|
-
- `
|
|
134
|
+
- `scripts/validate-permissions.sh` validates state-history command execution against `commands/**` role metadata and blocks obvious self-approval.
|
|
135
|
+
- `scripts/` is the canonical portable script source.
|
|
136
|
+
- `scripts/ai-core.sh` is a lightweight command runner that checks command role metadata before dispatching executable handlers.
|
|
137
|
+
- `scripts/workflow.sh` provides executable state-transition handlers for `/analyze-requirements`, `/groom-ticket`, `/mark-ready`, `/implement-task`, `/create-pr`, `/merge-pr`, `/smoke-test`, and `/release`.
|
|
138
|
+
- `skills/` provides chat-first behavior guidance inspired by skill-based systems: AI Core bootstrap, brainstorming, implementation planning, ticket execution, and verification-before-done.
|
|
139
139
|
- `/analyze-requirements` can create a linked spec in `docs/project/specs/`; `/write-plan` creates a linked implementation plan in `docs/project/plans/`.
|
|
140
|
-
- `
|
|
141
|
-
- `
|
|
140
|
+
- `scripts/validate-audit-log.sh` validates the hash chain in `project/audit-log.jsonl`; executable workflow handlers append audit records.
|
|
141
|
+
- `scripts/log-user-request.sh` appends every AI-handled user request to `project/user-requests.jsonl` so the user can review what they asked for.
|
|
142
142
|
- `/request-log` shows recent entries from `project/user-requests.jsonl`.
|
|
143
|
-
- `
|
|
144
|
-
- `CODEOWNERS` adds review ownership defaults for
|
|
145
|
-
- `config/docs-policy.json` can override documentation detection paths from `
|
|
146
|
-
- `.github/workflows/ai-core-governance.yml` is the portable governance workflow. App CI remains stack-specific and can be replaced with templates from `
|
|
147
|
-
- `scripts/setup-project.sh`
|
|
143
|
+
- `scripts/install-codex-prompts.sh` installs AI Core commands as Codex custom slash prompts in `~/.codex/prompts`.
|
|
144
|
+
- `CODEOWNERS` adds review ownership defaults for framework folders, `config/`, `project/`, ADRs, runbooks, and workflows.
|
|
145
|
+
- `config/docs-policy.json` can override documentation detection paths from `config/docs-policy.default.json`.
|
|
146
|
+
- `.github/workflows/ai-core-governance.yml` is the portable governance workflow. App CI remains stack-specific and can be replaced with templates from `templates/ci/`.
|
|
147
|
+
- `scripts/setup-project.sh` makes copied root-level framework installs executable: project config, runtime state folders, docs folders, backlog seed file, platform sync, and state validation.
|
|
148
148
|
- `.github/workflows/ci.yml` and `.github/workflows/validate-state.yml` run AI Core governance checks in CI.
|
|
149
149
|
- `.githooks/pre-commit` runs documentation gates before commit after hooks are installed with `bash scripts/install-hooks.sh`.
|
|
150
|
-
- `
|
|
150
|
+
- `config/release.schema.json` and `templates/release/release-record-template.json` define release approval, rollback, QA, security, and known-issue evidence.
|
|
151
151
|
- `scripts/generate-views.sh` now produces dashboard and release readiness views in `project/views/`.
|
|
152
152
|
|
|
153
153
|
Chat-first setup flow:
|
|
@@ -168,6 +168,6 @@ guide /analyze-requirements "User can reset password"
|
|
|
168
168
|
next TICKET-001
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
The normal interface is the AI chat window. The AI should infer the correct role from command metadata (`owner_agent` / `requires_agents`) and may use `
|
|
171
|
+
The normal interface is the AI chat window. The AI should infer the correct role from command metadata (`owner_agent` / `requires_agents`) and may use `scripts/ai-core.sh` internally for deterministic execution and validation. Users should not need to type `bash ...` or `AI_AGENT=...`.
|
|
172
172
|
|
|
173
173
|
`guide` runs one step, reports the completed command, ticket state before/after, updated `project` files, validation results, and the suggested next chat command. It asks before continuing and does not auto-run steps that still need placeholders such as `<story_points>` or `<pr_url>`.
|
|
@@ -94,7 +94,7 @@ Every User Story **MUST** pass INVEST. If it does not, you **MUST** split it int
|
|
|
94
94
|
A ticket **MUST NOT** transition to `READY` unless it has ≥3 AC scenarios.
|
|
95
95
|
|
|
96
96
|
### RULE BA-004: Template enforcement
|
|
97
|
-
You **MUST** use `
|
|
97
|
+
You **MUST** use `templates/requirements/user-story-template.md`. Freestyle formats are **FORBIDDEN**.
|
|
98
98
|
|
|
99
99
|
### RULE BA-005: Bug severity required
|
|
100
100
|
If the input is a **bug report**, you **MUST** determine severity:
|
|
@@ -24,7 +24,11 @@ write_access:
|
|
|
24
24
|
- "config/project-config.yaml"
|
|
25
25
|
- "config/project-structure.yaml"
|
|
26
26
|
read_access:
|
|
27
|
-
- "
|
|
27
|
+
- "agents/**"
|
|
28
|
+
- "rules/**"
|
|
29
|
+
- "skills/**"
|
|
30
|
+
- "templates/**"
|
|
31
|
+
- "workflows/**"
|
|
28
32
|
- "docs/**"
|
|
29
33
|
forbidden:
|
|
30
34
|
- "Make technical architecture decisions"
|
|
@@ -67,10 +71,10 @@ The Scrum Master MUST NOT:
|
|
|
67
71
|
## 🔒 Hard Rules
|
|
68
72
|
|
|
69
73
|
### RULE SM-001: State machine integrity
|
|
70
|
-
Every ticket transition MUST follow `
|
|
74
|
+
Every ticket transition MUST follow `rules/06-approval-gates.md`. The Scrum Master MUST run `/validate-state` before sprint start and before release.
|
|
71
75
|
|
|
72
76
|
### RULE SM-002: DoR gate ownership
|
|
73
|
-
Only the Scrum Master may execute `/mark-ready`. It MUST verify every item in `
|
|
77
|
+
Only the Scrum Master may execute `/mark-ready`. It MUST verify every item in `rules/07-definition-of-ready.md`.
|
|
74
78
|
|
|
75
79
|
### RULE SM-003: Capacity is a hard constraint
|
|
76
80
|
A sprint MUST NOT be planned above configured capacity unless the overflow is explicitly documented as risk and approved by a human.
|
package/bin/ai-core-framework.js
CHANGED
|
@@ -8,7 +8,7 @@ const { stdin, stdout } = require('node:process');
|
|
|
8
8
|
const { installCodex } = require('../lib/install-codex');
|
|
9
9
|
|
|
10
10
|
const packageRoot = path.resolve(__dirname, '..');
|
|
11
|
-
const
|
|
11
|
+
const sourceFrameworkDir = packageRoot;
|
|
12
12
|
|
|
13
13
|
function normalizeAnswer(answer) {
|
|
14
14
|
return answer.trim().toLowerCase();
|
|
@@ -54,8 +54,8 @@ async function main() {
|
|
|
54
54
|
const rl = createPrompter();
|
|
55
55
|
|
|
56
56
|
try {
|
|
57
|
-
if (!fs.existsSync(
|
|
58
|
-
throw new Error(`Package is missing
|
|
57
|
+
if (!fs.existsSync(path.join(sourceFrameworkDir, 'skills'))) {
|
|
58
|
+
throw new Error(`Package is missing framework assets: ${sourceFrameworkDir}`);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const selectedCli = await chooseCli(rl);
|
|
@@ -71,7 +71,7 @@ async function main() {
|
|
|
71
71
|
|
|
72
72
|
const result = await installCodex({
|
|
73
73
|
targetDir,
|
|
74
|
-
|
|
74
|
+
sourceFrameworkDir,
|
|
75
75
|
confirm: (question) => askConflict(rl, question),
|
|
76
76
|
});
|
|
77
77
|
|
package/hooks/hooks.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
6
|
+
SKILL_FILE="${PLUGIN_ROOT}/skills/using-ai-core/SKILL.md"
|
|
7
|
+
|
|
8
|
+
if [ ! -f "$SKILL_FILE" ]; then
|
|
9
|
+
context="AI Core is installed, but skills/using-ai-core/SKILL.md was not found. Ask the user to run /setup-project or verify plugin installation."
|
|
10
|
+
else
|
|
11
|
+
content=$(sed 's/\\/\\\\/g; s/"/\\"/g; s/$/\\n/' "$SKILL_FILE" | tr -d '\n')
|
|
12
|
+
context="<AI_CORE_BOOTSTRAP>\\nYou are using AI Core. Read and follow this bootstrap skill before workflow work:\\n\\n${content}</AI_CORE_BOOTSTRAP>"
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
|
|
16
|
+
printf '{\n "additional_context": "%s"\n}\n' "$context"
|
|
17
|
+
elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
|
|
18
|
+
printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$context"
|
|
19
|
+
else
|
|
20
|
+
printf '{\n "additionalContext": "%s"\n}\n' "$context"
|
|
21
|
+
fi
|
package/lib/install-codex.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
const fs = require('node:fs');
|
|
2
2
|
const path = require('node:path');
|
|
3
3
|
|
|
4
|
+
const FRAMEWORK_ENTRIES = [
|
|
5
|
+
'agents',
|
|
6
|
+
'config',
|
|
7
|
+
'hooks',
|
|
8
|
+
'rules',
|
|
9
|
+
'scripts',
|
|
10
|
+
'skills',
|
|
11
|
+
'templates',
|
|
12
|
+
'workflows',
|
|
13
|
+
'README.md',
|
|
14
|
+
];
|
|
15
|
+
|
|
4
16
|
function listFiles(rootDir) {
|
|
5
17
|
const files = [];
|
|
6
18
|
|
|
@@ -20,13 +32,33 @@ function listFiles(rootDir) {
|
|
|
20
32
|
return files;
|
|
21
33
|
}
|
|
22
34
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
function listFrameworkFiles(sourceFrameworkDir) {
|
|
36
|
+
const files = [];
|
|
37
|
+
|
|
38
|
+
for (const entry of FRAMEWORK_ENTRIES) {
|
|
39
|
+
const entryPath = path.join(sourceFrameworkDir, entry);
|
|
40
|
+
|
|
41
|
+
if (!fs.existsSync(entryPath)) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (fs.statSync(entryPath).isDirectory()) {
|
|
46
|
+
files.push(...listFiles(entryPath));
|
|
47
|
+
} else {
|
|
48
|
+
files.push(entryPath);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return files;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function installCodex({ targetDir = process.cwd(), sourceFrameworkDir, confirm }) {
|
|
56
|
+
if (!sourceFrameworkDir) {
|
|
57
|
+
throw new Error('sourceFrameworkDir is required');
|
|
26
58
|
}
|
|
27
59
|
|
|
28
|
-
if (!fs.existsSync(
|
|
29
|
-
throw new Error(`Source
|
|
60
|
+
if (!fs.existsSync(sourceFrameworkDir) || !fs.statSync(sourceFrameworkDir).isDirectory()) {
|
|
61
|
+
throw new Error(`Source framework directory not found: ${sourceFrameworkDir}`);
|
|
30
62
|
}
|
|
31
63
|
|
|
32
64
|
const targetCodexDir = path.join(targetDir, '.codex');
|
|
@@ -39,8 +71,8 @@ async function installCodex({ targetDir = process.cwd(), sourceCoreDir, confirm
|
|
|
39
71
|
|
|
40
72
|
fs.mkdirSync(targetCodexDir, { recursive: true });
|
|
41
73
|
|
|
42
|
-
for (const sourceFile of
|
|
43
|
-
const relativePath = path.relative(
|
|
74
|
+
for (const sourceFile of listFrameworkFiles(sourceFrameworkDir)) {
|
|
75
|
+
const relativePath = path.relative(sourceFrameworkDir, sourceFile);
|
|
44
76
|
const targetFile = path.join(targetCodexDir, relativePath);
|
|
45
77
|
let shouldCopy = true;
|
|
46
78
|
let overwriting = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-core-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Chat-first enterprise AI SDLC framework installer for AI coding CLIs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -19,8 +19,15 @@
|
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"bin/",
|
|
22
|
-
"
|
|
22
|
+
"agents/",
|
|
23
|
+
"config/",
|
|
24
|
+
"hooks/",
|
|
23
25
|
"lib/",
|
|
26
|
+
"rules/",
|
|
27
|
+
"scripts/",
|
|
28
|
+
"skills/",
|
|
29
|
+
"templates/",
|
|
30
|
+
"workflows/",
|
|
24
31
|
"README.md",
|
|
25
32
|
".codex-plugin/",
|
|
26
33
|
".claude-plugin/",
|
|
@@ -36,7 +36,7 @@ If a rule says **MUST** or **MUST NOT**, it is mandatory and has **NO EXCEPTIONS
|
|
|
36
36
|
**Allowed exceptions**:
|
|
37
37
|
- Fix typos in comments
|
|
38
38
|
- Fix formatting or lint issues, with a separate commit: `style(chore): ...`
|
|
39
|
-
- Update files in
|
|
39
|
+
- Update files in root-level framework folders, which are the meta-framework
|
|
40
40
|
|
|
41
41
|
**If the user requests code without a ticket:**
|
|
42
42
|
```
|
|
@@ -62,12 +62,12 @@ If a rule says **MUST** or **MUST NOT**, it is mandatory and has **NO EXCEPTIONS
|
|
|
62
62
|
| Project structure map | `config/project-structure.yaml` |
|
|
63
63
|
| Refactor plans | `docs/runtime/refactor/<name>-refactor-plan.md` |
|
|
64
64
|
| Architecture decisions | `docs/runtime/adr/NNN-title.md` |
|
|
65
|
-
| Agent capabilities | `
|
|
65
|
+
| Agent capabilities | `agents/<agent>.md` (frontmatter) |
|
|
66
66
|
| Coverage threshold | `config/project-config.yaml` → `quality.coverage_threshold` |
|
|
67
67
|
|
|
68
68
|
If information is needed in multiple places, **reference** the canonical location. **MUST NOT** copy it.
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
Root-level framework folders are framework-only. Project-specific state and configuration MUST live in `project/`, `config/`, `docs/project/`, or `docs/runtime/`.
|
|
71
71
|
|
|
72
72
|
---
|
|
73
73
|
|
|
@@ -97,7 +97,7 @@ User workflow interaction happens in the AI chat window.
|
|
|
97
97
|
|
|
98
98
|
When user types `/command ...`, `guide /command ...`, or `next TICKET-XXX`, AI **MUST** treat it as an AI Core workflow request, infer the right agent from command metadata, execute any internal scripts itself when needed, and report the result back in chat.
|
|
99
99
|
|
|
100
|
-
AI **MUST NOT** require the user to type shell wrappers such as `bash
|
|
100
|
+
AI **MUST NOT** require the user to type shell wrappers such as `bash scripts/ai-core.sh` or environment variables such as `AI_AGENT=...` for normal workflow usage. Those are internal implementation details for AI tooling and CI.
|
|
101
101
|
|
|
102
102
|
### G-004b: Always output the execution plan
|
|
103
103
|
Before executing a complex command, the AI **MUST** output a short plan:
|
|
@@ -141,11 +141,11 @@ The log record **MUST** include:
|
|
|
141
141
|
- User request text, sanitized for secrets
|
|
142
142
|
- Detected slash command, if any
|
|
143
143
|
- Detected ticket ID, if any
|
|
144
|
-
- Hash chain fields when using `
|
|
144
|
+
- Hash chain fields when using `scripts/log-user-request.sh`
|
|
145
145
|
|
|
146
146
|
The AI **MUST** use:
|
|
147
147
|
```bash
|
|
148
|
-
bash
|
|
148
|
+
bash scripts/log-user-request.sh "<user request text>"
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
If the script is unavailable, the AI **MUST** still write an equivalent JSONL record manually. If the request contains secrets, credentials, tokens, passwords, customer PII, or payment data, the AI **MUST** redact those values before logging.
|
|
@@ -54,7 +54,7 @@ Known misleading docs for changed behavior MUST be fixed before release.
|
|
|
54
54
|
## 🛠️ Enforcement
|
|
55
55
|
|
|
56
56
|
- Developer checklist in `/implement-task`.
|
|
57
|
-
- PR template in `
|
|
57
|
+
- PR template in `templates/pr/`.
|
|
58
58
|
- Tech Lead review.
|
|
59
59
|
- Release checklist in `/release`.
|
|
60
60
|
- `bash scripts/validate-docs.sh` blocks missing documentation evidence in CI and pre-commit.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/ai-core.sh
|
|
3
3
|
#
|
|
4
4
|
# Lightweight command runner for executable AI Core commands.
|
|
5
5
|
#
|
|
@@ -21,7 +21,7 @@ log_warn() { echo -e "${YELLOW}!${NC} $1"; }
|
|
|
21
21
|
log_fail() { echo -e "${RED}x${NC} $1"; }
|
|
22
22
|
|
|
23
23
|
AI_CORE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
24
|
-
PROJECT_ROOT="$
|
|
24
|
+
PROJECT_ROOT="$AI_CORE_DIR"
|
|
25
25
|
|
|
26
26
|
usage() {
|
|
27
27
|
cat <<'EOF'
|
|
@@ -32,10 +32,10 @@ Usage:
|
|
|
32
32
|
next TICKET-XXX
|
|
33
33
|
|
|
34
34
|
Internal runner form:
|
|
35
|
-
bash
|
|
36
|
-
bash
|
|
37
|
-
bash
|
|
38
|
-
bash
|
|
35
|
+
bash scripts/ai-core.sh [--agent role] run /command [args...]
|
|
36
|
+
bash scripts/ai-core.sh [--agent role] guide /command [args...]
|
|
37
|
+
bash scripts/ai-core.sh [--agent role] next TICKET-XXX
|
|
38
|
+
bash scripts/ai-core.sh list
|
|
39
39
|
|
|
40
40
|
Environment:
|
|
41
41
|
AI_AGENT=<agent-role> Optional internal override. Runner auto-selects owner_agent by default.
|
|
@@ -60,7 +60,21 @@ command_file_for() {
|
|
|
60
60
|
local command="$1"
|
|
61
61
|
local name
|
|
62
62
|
name=$(command_name "$command")
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
if [ -d "$AI_CORE_DIR/commands" ]; then
|
|
65
|
+
find "$AI_CORE_DIR/commands" -name "$name.md" -type f | head -1
|
|
66
|
+
return 0
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
if [ -d "$AI_CORE_DIR/skills" ]; then
|
|
70
|
+
find "$AI_CORE_DIR/skills" -name 'SKILL.md' -type f -print0 |
|
|
71
|
+
while IFS= read -r -d '' file; do
|
|
72
|
+
if awk -v command="/$name" '$1 == "command:" && $2 == command { found=1 } END { exit found ? 0 : 1 }' "$file"; then
|
|
73
|
+
printf '%s\n' "$file"
|
|
74
|
+
break
|
|
75
|
+
fi
|
|
76
|
+
done
|
|
77
|
+
fi
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
allowed_agents_for_command() {
|
|
@@ -388,12 +402,20 @@ next_command() {
|
|
|
388
402
|
}
|
|
389
403
|
|
|
390
404
|
list_commands() {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
405
|
+
{
|
|
406
|
+
if [ -d "$AI_CORE_DIR/commands" ]; then
|
|
407
|
+
find "$AI_CORE_DIR/commands" -name '*.md' -type f |
|
|
408
|
+
grep -v '/README.md$' |
|
|
409
|
+
sed "s#^$AI_CORE_DIR/commands/##" |
|
|
410
|
+
sed 's#/# #g; s#\.md$##' |
|
|
411
|
+
awk '{ print "/" $NF }'
|
|
412
|
+
fi
|
|
413
|
+
|
|
414
|
+
if [ -d "$AI_CORE_DIR/skills" ]; then
|
|
415
|
+
find "$AI_CORE_DIR/skills" -name 'SKILL.md' -type f -print0 |
|
|
416
|
+
xargs -0 awk '$1 == "command:" { print $2 }'
|
|
417
|
+
fi
|
|
418
|
+
} | sort -u
|
|
397
419
|
}
|
|
398
420
|
|
|
399
421
|
main() {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/install-codex-prompts.sh
|
|
3
3
|
#
|
|
4
4
|
# Installs AI Core command wrappers as Codex custom slash prompts.
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
|
-
# bash
|
|
8
|
-
# CODEX_PROMPTS_DIR=~/.codex/prompts bash
|
|
7
|
+
# bash scripts/install-codex-prompts.sh
|
|
8
|
+
# CODEX_PROMPTS_DIR=~/.codex/prompts bash scripts/install-codex-prompts.sh
|
|
9
9
|
|
|
10
10
|
set -euo pipefail
|
|
11
11
|
|
|
@@ -50,9 +50,9 @@ write_prompt() {
|
|
|
50
50
|
prompt_file="$PROMPTS_DIR/${command#/}.md"
|
|
51
51
|
rel_command_file="${command_file#./}"
|
|
52
52
|
fallback_command_file="${root}/${rel_command_file}"
|
|
53
|
-
fallback_rules_file="${root}/
|
|
54
|
-
fallback_agents_dir="${root}/
|
|
55
|
-
fallback_log_script="${root}/
|
|
53
|
+
fallback_rules_file="${root}/rules/00-global-rules.md"
|
|
54
|
+
fallback_agents_dir="${root}/agents"
|
|
55
|
+
fallback_log_script="${root}/scripts/log-user-request.sh"
|
|
56
56
|
description="${display_name:-AI Core command ${command}}"
|
|
57
57
|
|
|
58
58
|
cat > "$prompt_file" <<EOF
|
|
@@ -72,8 +72,8 @@ Mandatory steps:
|
|
|
72
72
|
|
|
73
73
|
1. Log this user request first. Prefer the project-local script when it exists; otherwise use the installed AI Core fallback:
|
|
74
74
|
\`\`\`bash
|
|
75
|
-
if [ -f
|
|
76
|
-
AI_AGENT=codex bash
|
|
75
|
+
if [ -f scripts/log-user-request.sh ]; then
|
|
76
|
+
AI_AGENT=codex bash scripts/log-user-request.sh "${command} \$ARGUMENTS"
|
|
77
77
|
else
|
|
78
78
|
AI_AGENT=codex bash ${fallback_log_script} "${command} \$ARGUMENTS"
|
|
79
79
|
fi
|
|
@@ -87,13 +87,13 @@ Mandatory steps:
|
|
|
87
87
|
|
|
88
88
|
3. Read and follow the global rules. Prefer the project-local path when it exists; otherwise use the installed AI Core fallback:
|
|
89
89
|
\`\`\`text
|
|
90
|
-
|
|
90
|
+
rules/00-global-rules.md
|
|
91
91
|
${fallback_rules_file}
|
|
92
92
|
\`\`\`
|
|
93
93
|
|
|
94
94
|
4. Infer the owner agent from the command frontmatter. If an agent file exists, read it before acting. Prefer the project-local path, then the installed fallback:
|
|
95
95
|
\`\`\`text
|
|
96
|
-
|
|
96
|
+
agents/<owner_agent>.md
|
|
97
97
|
${fallback_agents_dir}/<owner_agent>.md
|
|
98
98
|
\`\`\`
|
|
99
99
|
|
|
@@ -110,16 +110,24 @@ main() {
|
|
|
110
110
|
root="$(repo_root)"
|
|
111
111
|
cd "$root"
|
|
112
112
|
|
|
113
|
-
if [ ! -d "
|
|
114
|
-
log_fail "Missing
|
|
113
|
+
if [ ! -d "commands" ] && [ ! -d "skills" ]; then
|
|
114
|
+
log_fail "Missing commands or skills. Run from AI Core repo root."
|
|
115
115
|
exit 1
|
|
116
116
|
fi
|
|
117
117
|
|
|
118
118
|
mkdir -p "$PROMPTS_DIR"
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
if [ -d "commands" ]; then
|
|
121
|
+
while IFS= read -r command_file; do
|
|
122
|
+
write_prompt "$command_file" "$root"
|
|
123
|
+
done < <(find commands -name '*.md' -type f | sort)
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
if [ -d "skills" ]; then
|
|
127
|
+
while IFS= read -r command_file; do
|
|
128
|
+
write_prompt "$command_file" "$root"
|
|
129
|
+
done < <(find skills -name 'SKILL.md' -type f | sort)
|
|
130
|
+
fi
|
|
123
131
|
|
|
124
132
|
log_pass "AI Core Codex prompts installed in ${PROMPTS_DIR}"
|
|
125
133
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/log-user-request.sh
|
|
3
3
|
#
|
|
4
4
|
# Append a sanitized user request record to project/user-requests.jsonl.
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
|
-
# bash
|
|
7
|
+
# bash scripts/log-user-request.sh "user request text"
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ log_pass() { echo -e "${GREEN}+${NC} $1"; }
|
|
|
19
19
|
log_fail() { echo -e "${RED}x${NC} $1"; }
|
|
20
20
|
|
|
21
21
|
if [ -z "$REQUEST_TEXT" ]; then
|
|
22
|
-
log_fail "Usage: bash
|
|
22
|
+
log_fail "Usage: bash scripts/log-user-request.sh \"user request text\""
|
|
23
23
|
exit 2
|
|
24
24
|
fi
|
|
25
25
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
2
|
+
# scripts/setup-project.sh
|
|
3
3
|
#
|
|
4
|
-
# Makes
|
|
4
|
+
# Makes copied root-level framework folders operational in a project.
|
|
5
5
|
#
|
|
6
6
|
# Usage:
|
|
7
|
-
# bash
|
|
7
|
+
# bash scripts/setup-project.sh
|
|
8
8
|
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
|
|
@@ -48,7 +48,7 @@ install_framework_scripts() {
|
|
|
48
48
|
mkdir -p scripts
|
|
49
49
|
|
|
50
50
|
for script in ai-core.sh workflow.sh validate-state.sh validate-docs.sh validate-permissions.sh validate-audit-log.sh generate-views.sh install-codex-prompts.sh log-user-request.sh setup-project.sh; do
|
|
51
|
-
local src="
|
|
51
|
+
local src="scripts/$script"
|
|
52
52
|
local dst="scripts/$script"
|
|
53
53
|
|
|
54
54
|
if [ ! -f "$src" ]; then
|
|
@@ -68,7 +68,7 @@ install_framework_scripts() {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
install_governance_workflow() {
|
|
71
|
-
local src="
|
|
71
|
+
local src="templates/ci/ai-core-governance.yml"
|
|
72
72
|
local dst=".github/workflows/ai-core-governance.yml"
|
|
73
73
|
|
|
74
74
|
if [ ! -f "$src" ]; then
|
|
@@ -103,22 +103,17 @@ main() {
|
|
|
103
103
|
repo_root=$(git rev-parse --show-toplevel)
|
|
104
104
|
cd "$repo_root"
|
|
105
105
|
|
|
106
|
-
if [ ! -
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
fi
|
|
110
|
-
|
|
111
|
-
if [ ! -f "core/templates/project/project-config.yaml" ] ||
|
|
112
|
-
[ ! -f "core/templates/project/project-structure.yaml" ]; then
|
|
113
|
-
log_fail "Missing core project templates"
|
|
106
|
+
if [ ! -f "templates/project/project-config.yaml" ] ||
|
|
107
|
+
[ ! -f "templates/project/project-structure.yaml" ]; then
|
|
108
|
+
log_fail "Missing framework project templates"
|
|
114
109
|
exit 1
|
|
115
110
|
fi
|
|
116
111
|
|
|
117
112
|
mkdir -p config
|
|
118
|
-
copy_if_missing "
|
|
119
|
-
copy_if_missing "
|
|
120
|
-
copy_if_missing "
|
|
121
|
-
copy_if_missing "
|
|
113
|
+
copy_if_missing "templates/project/project-config.yaml" "config/project-config.yaml"
|
|
114
|
+
copy_if_missing "templates/project/project-structure.yaml" "config/project-structure.yaml"
|
|
115
|
+
copy_if_missing "templates/project/docs-policy.json" "config/docs-policy.json"
|
|
116
|
+
copy_if_missing "templates/project/CODEOWNERS" "CODEOWNERS"
|
|
122
117
|
|
|
123
118
|
for dir in \
|
|
124
119
|
project/tickets \
|
|
@@ -157,16 +152,16 @@ main() {
|
|
|
157
152
|
install_framework_scripts
|
|
158
153
|
install_governance_workflow
|
|
159
154
|
|
|
160
|
-
if [ -f "
|
|
161
|
-
bash
|
|
155
|
+
if [ -f "scripts/sync-platforms.sh" ]; then
|
|
156
|
+
bash scripts/sync-platforms.sh
|
|
162
157
|
else
|
|
163
|
-
log_warn "Missing
|
|
158
|
+
log_warn "Missing scripts/sync-platforms.sh; platform configs not synced"
|
|
164
159
|
fi
|
|
165
160
|
|
|
166
|
-
if [ -f "
|
|
167
|
-
bash
|
|
161
|
+
if [ -f "scripts/validate-state.sh" ]; then
|
|
162
|
+
bash scripts/validate-state.sh
|
|
168
163
|
else
|
|
169
|
-
log_warn "Missing
|
|
164
|
+
log_warn "Missing scripts/validate-state.sh; skipped state validation"
|
|
170
165
|
fi
|
|
171
166
|
|
|
172
167
|
if [ -d ".githooks" ] && [ -f "scripts/install-hooks.sh" ]; then
|