@anhlp/alp-core 0.0.1-beta.7 → 0.0.1-beta.8

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 (124) hide show
  1. package/dist/library-edit.d.ts +51 -2
  2. package/dist/library-edit.js +160 -8
  3. package/dist/library.d.ts +14 -1
  4. package/dist/library.js +73 -5
  5. package/dist/models.d.ts +35 -0
  6. package/dist/models.js +17 -1
  7. package/dist/packs.d.ts +57 -0
  8. package/dist/packs.js +247 -0
  9. package/dist/permissions.d.ts +3 -2
  10. package/dist/permissions.js +6 -3
  11. package/dist/profiles.js +3 -3
  12. package/dist/providers.d.ts +2 -4
  13. package/dist/providers.js +20 -4
  14. package/dist/skill-validate.d.ts +85 -0
  15. package/dist/skill-validate.js +298 -0
  16. package/dist/upgrade.d.ts +10 -0
  17. package/dist/upgrade.js +112 -6
  18. package/dist/validation.js +2 -3
  19. package/package.json +18 -2
  20. package/src/library-edit.js +170 -8
  21. package/src/library.js +96 -6
  22. package/src/models.js +24 -0
  23. package/src/packs.js +246 -0
  24. package/src/permissions.d.ts +3 -2
  25. package/src/permissions.js +13 -3
  26. package/src/profiles.js +4 -4
  27. package/src/providers.js +20 -5
  28. package/src/resolver.js +1 -1
  29. package/src/skill-validate.js +287 -0
  30. package/src/upgrade.js +54 -6
  31. package/src/validation.js +3 -4
  32. package/templates/ALP.md +52 -52
  33. package/templates/agents/lead/AGENT.md +77 -74
  34. package/templates/agents/main/AGENT.md +153 -145
  35. package/templates/agents/oracle/AGENT.md +38 -37
  36. package/templates/agents/peer/AGENT.md +56 -52
  37. package/templates/agents/reviewer/AGENT.md +63 -65
  38. package/templates/agents/supervisor/AGENT.md +63 -63
  39. package/templates/packs/architecture/agents/architect/AGENT.md +41 -0
  40. package/templates/packs/architecture/agents/architect/agent.json +5 -0
  41. package/templates/packs/architecture/agents/docs-maintainer/AGENT.md +33 -0
  42. package/templates/packs/architecture/agents/docs-maintainer/agent.json +4 -0
  43. package/templates/packs/architecture/pack.json +7 -0
  44. package/templates/packs/architecture/teams/blueprint/HOUSE_RULES.md +12 -0
  45. package/templates/packs/architecture/teams/blueprint/team.json +19 -0
  46. package/templates/packs/backend/pack.json +6 -0
  47. package/templates/packs/backend/skills/backend-development/SKILL.md +102 -0
  48. package/templates/packs/backend/skills/backend-development/references/api-design.md +96 -0
  49. package/templates/packs/backend/skills/backend-development/references/authentication.md +78 -0
  50. package/templates/packs/backend/skills/backend-development/references/error-handling.md +86 -0
  51. package/templates/packs/backend/skills/backend-development/references/testing.md +81 -0
  52. package/templates/packs/backend/skills/databases/SKILL.md +103 -0
  53. package/templates/packs/backend/skills/databases/references/query-performance.md +87 -0
  54. package/templates/packs/backend/skills/databases/references/schema-and-migrations.md +87 -0
  55. package/templates/packs/design/pack.json +6 -0
  56. package/templates/packs/design/skills/ui-design/SKILL.md +86 -0
  57. package/templates/packs/design/skills/ui-design/references/design-tokens.md +67 -0
  58. package/templates/packs/design/skills/ui-design/references/interaction-states.md +73 -0
  59. package/templates/packs/design/skills/ui-design/references/layout-and-typography.md +71 -0
  60. package/templates/packs/design/skills/ui-design/references/ui-review.md +83 -0
  61. package/templates/packs/frontend/pack.json +6 -0
  62. package/templates/packs/frontend/skills/frontend-development/SKILL.md +105 -0
  63. package/templates/packs/frontend/skills/frontend-development/references/accessibility.md +86 -0
  64. package/templates/packs/frontend/skills/frontend-development/references/components-and-state.md +79 -0
  65. package/templates/packs/frontend/skills/frontend-development/references/data-fetching.md +86 -0
  66. package/templates/packs/frontend/skills/frontend-development/references/frameworks.md +77 -0
  67. package/templates/packs/frontend/skills/frontend-development/references/performance.md +78 -0
  68. package/templates/packs/integration/pack.json +6 -0
  69. package/templates/packs/integration/skills/mcp-integration/SKILL.md +100 -0
  70. package/templates/packs/integration/skills/mcp-integration/references/server-implementation.md +95 -0
  71. package/templates/packs/integration/skills/mcp-integration/references/testing.md +78 -0
  72. package/templates/packs/integration/skills/mcp-integration/references/tool-design.md +97 -0
  73. package/templates/packs/operations/pack.json +6 -0
  74. package/templates/packs/operations/skills/devops/SKILL.md +85 -0
  75. package/templates/packs/operations/skills/devops/references/ci-cd.md +84 -0
  76. package/templates/packs/operations/skills/devops/references/containers.md +85 -0
  77. package/templates/packs/operations/skills/devops/references/deployment-and-rollback.md +85 -0
  78. package/templates/packs/operations/skills/devops/references/observability.md +86 -0
  79. package/templates/packs/quality/pack.json +6 -0
  80. package/templates/packs/quality/skills/web-testing/SKILL.md +102 -0
  81. package/templates/packs/quality/skills/web-testing/references/e2e.md +85 -0
  82. package/templates/packs/quality/skills/web-testing/references/performance-testing.md +85 -0
  83. package/templates/packs/quality/skills/web-testing/references/security-testing.md +78 -0
  84. package/templates/packs/quality/skills/web-testing/references/unit-and-component.md +78 -0
  85. package/templates/role-skills.json +4 -4
  86. package/templates/skills/architecture-docs/SKILL.md +81 -0
  87. package/templates/skills/architecture-docs/references/adr.md +62 -0
  88. package/templates/skills/architecture-docs/references/diagrams.md +60 -0
  89. package/templates/skills/architecture-docs/references/evidence-rules.md +49 -0
  90. package/templates/skills/bug-loop/SKILL.md +41 -40
  91. package/templates/skills/bug-loop/references/test-proof.md +21 -19
  92. package/templates/skills/compact/SKILL.md +2 -2
  93. package/templates/skills/curate/SKILL.md +6 -5
  94. package/templates/skills/feature-architecture/SKILL.md +90 -0
  95. package/templates/skills/feature-architecture/references/architecture-contract.md +95 -0
  96. package/templates/skills/feature-architecture/references/feature-design.md +69 -0
  97. package/templates/skills/feature-architecture/scripts/check-boundaries.mjs +270 -0
  98. package/templates/skills/goal-griller/SKILL.md +27 -27
  99. package/templates/skills/prompt-leverage/SKILL.md +29 -27
  100. package/templates/skills/prompt-leverage/references/brief-template.md +9 -9
  101. package/templates/skills/release-readiness/SKILL.md +83 -0
  102. package/templates/skills/release-readiness/references/checklist.md +40 -0
  103. package/templates/skills/release-readiness/references/verdict-template.md +53 -0
  104. package/templates/skills/safe-refactor/SKILL.md +84 -0
  105. package/templates/skills/safe-refactor/references/characterization-tests.md +57 -0
  106. package/templates/skills/safe-refactor/references/compatibility-checklist.md +56 -0
  107. package/templates/skills/security-review/SKILL.md +87 -0
  108. package/templates/skills/security-review/references/checklist.md +74 -0
  109. package/templates/skills/security-review/references/severity.md +61 -0
  110. package/templates/skills/sequence-execution-plan/SKILL.md +41 -38
  111. package/templates/skills/sequence-execution-plan/references/plan-template.md +5 -5
  112. package/templates/skills/skill-authoring/SKILL.md +84 -0
  113. package/templates/skills/skill-authoring/references/evaluation.md +45 -0
  114. package/templates/skills/skill-authoring/references/skill-anatomy.md +74 -0
  115. package/templates/skills/skill-authoring/references/trigger-design.md +52 -0
  116. package/templates/skills/smart-commits/SKILL.md +37 -36
  117. package/templates/skills/test-strategy/SKILL.md +83 -0
  118. package/templates/skills/test-strategy/references/contract-tests.md +46 -0
  119. package/templates/skills/test-strategy/references/risk-matrix.md +53 -0
  120. package/templates/skills/xia/SKILL.md +40 -38
  121. package/templates/teams/cafe/HOUSE_RULES.md +1 -1
  122. package/templates/teams/cafe/team.json +1 -1
  123. package/templates/teams/pho/HOUSE_RULES.md +1 -1
  124. package/templates/teams/pho/team.json +1 -1
@@ -0,0 +1,287 @@
1
+ import { lstat, readFile, readdir, realpath, stat } from 'node:fs/promises';
2
+ import path from 'node:path';
3
+
4
+ /**
5
+ * Skill validation (Agent Skills format, https://agentskills.io/specification): a skill is a
6
+ * directory holding SKILL.md, whose YAML frontmatter names it and says what it is for, and the
7
+ * references, scripts and assets SKILL.md points to.
8
+ *
9
+ * Two modes. `strict` is for skills ALP ships, packs and new skills: format problems are errors.
10
+ * `legacy` (the default) is for skills already in a user's library or project: format problems
11
+ * are warnings with a migration hint, since ALP never rewrites them and the runtime keeps loading
12
+ * them. A symlink leaving the skill, a broken symlink or an unreadable file is an error in both
13
+ * modes; a plain path leaving the skill is an error in strict mode and a warning in legacy mode. Validation only reads; it never runs a script or follows a link outside the skill.
14
+ */
15
+
16
+ /** Frontmatter keys of the Agent Skills specification. */
17
+ export const SPEC_KEYS = ['name', 'description', 'license', 'compatibility', 'metadata', 'allowed-tools'];
18
+ /** Keys other runtimes add (Claude Code); kept, reported as runtime-specific in strict mode. */
19
+ const RUNTIME_KEYS = ['argument-hint', 'disable-model-invocation', 'user-invocable', 'model', 'version', 'when_to_use', 'mode'];
20
+ export const NAME_MAX = 64;
21
+ export const DESCRIPTION_MAX = 1024;
22
+ /** How much of a description ALP's skill index shows (resolve.ts SKILL_DESCRIPTION_CHARS). */
23
+ export const INDEX_DESCRIPTION_CHARS = 400;
24
+ const COMPATIBILITY_MAX = 500;
25
+ const BODY_LINES_RECOMMENDED = 500;
26
+ const MAX_FILES = 2000;
27
+
28
+
29
+ const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
30
+ /** A trigger cue: the description says when to use the skill. */
31
+ const TRIGGER_RE = /\b(use|when|before|after|whenever|for)\b|dùng|khi/i;
32
+
33
+ /** Whether `name` follows the specification's name rules. */
34
+ export const specName = name => typeof name === 'string' && name.length >= 1 && name.length <= NAME_MAX && NAME_RE.test(name);
35
+
36
+ /** A YAML double-quoted scalar's escapes (the JSON subset plus \/ and \e not needed here). */
37
+ function doubleQuoted(raw) {
38
+ try { return JSON.parse(`"${raw.replace(/\\'/g, "'")}"`); } catch { return undefined; }
39
+ }
40
+
41
+ /**
42
+ * Parses the YAML subset skills use: `key: scalar`, quoted scalars, block scalars (`|`, `>`),
43
+ * multi-line plain scalars, comments, and one level of `key:` + indented `sub: value` (metadata).
44
+ * Anything else (sequences, flow collections, anchors, tags) is reported as unsupported.
45
+ * @returns {{ data: Record<string, unknown>, problems: string[] }}
46
+ */
47
+ export function parseFrontmatter(text) {
48
+ const lines = text.split(/\r?\n/);
49
+ const data = {};
50
+ const problems = [];
51
+ const indent = line => /^ */.exec(line)[0].length;
52
+ let i = 0;
53
+ const scalar = (raw, key, baseIndent) => {
54
+ const value = raw.trim();
55
+ if (!value) {
56
+ // A nested mapping, or an empty value.
57
+ const nested = {};
58
+ let found = false;
59
+ while (i < lines.length && (lines[i].trim() === '' || lines[i].trimStart().startsWith('#') || indent(lines[i]) > baseIndent)) {
60
+ const line = lines[i++];
61
+ if (!line.trim() || line.trimStart().startsWith('#')) continue;
62
+ const match = /^\s+([^:#\s][^:]*?):(?:\s+(.*)|\s*)$/.exec(line);
63
+ if (!match) { problems.push(`${key}: unsupported YAML in '${line.trim()}' (use "key: value" lines)`); continue; }
64
+ found = true;
65
+ nested[match[1].trim()] = scalar(match[2] ?? '', `${key}.${match[1].trim()}`, indent(line));
66
+ }
67
+ return found ? nested : '';
68
+ }
69
+ if (value.startsWith('"')) {
70
+ const end = /^"((?:[^"\\]|\\.)*)"\s*(?:#.*)?$/.exec(value);
71
+ if (!end) { problems.push(`${key}: unterminated or multi-line double-quoted value`); return undefined; }
72
+ const parsed = doubleQuoted(end[1]);
73
+ if (parsed === undefined) problems.push(`${key}: invalid escape in double-quoted value`);
74
+ return parsed;
75
+ }
76
+ if (value.startsWith("'")) {
77
+ const end = /^'((?:[^']|'')*)'\s*(?:#.*)?$/.exec(value);
78
+ if (!end) { problems.push(`${key}: unterminated or multi-line single-quoted value`); return undefined; }
79
+ return end[1].replaceAll("''", "'");
80
+ }
81
+ const block = /^([|>])([+-]?)([1-9]?)([+-]?)\s*(?:#.*)?$/.exec(value);
82
+ if (block?.[3]) problems.push(`${key}: block scalar indentation indicators are not supported; indent the text instead`);
83
+ if (block) {
84
+ const body = [];
85
+ while (i < lines.length && (lines[i].trim() === '' || indent(lines[i]) > baseIndent)) body.push(lines[i++]);
86
+ while (body.length && !body[body.length - 1].trim()) body.pop();
87
+ const width = Math.min(...body.filter(line => line.trim()).map(indent));
88
+ const content = body.map(line => line.slice(Number.isFinite(width) ? width : 0));
89
+ const joined = block[1] === '|' ? content.join('\n') : content.join('\n').replace(/([^\n])\n(?=[^\n])/g, '$1 ');
90
+ return (block[2] || block[4]) === '-' ? joined : `${joined}\n`;
91
+ }
92
+ if (/^[[{&*!%@`]/.test(value) || value.startsWith('- ')) {
93
+ problems.push(`${key}: unsupported YAML value '${value.slice(0, 40)}' (use a plain or quoted string)`);
94
+ return undefined;
95
+ }
96
+ let plain = value.replace(/\s+#.*$/, '');
97
+ // A plain scalar may continue on more-indented lines.
98
+ while (i < lines.length && lines[i].trim() && indent(lines[i]) > baseIndent && !lines[i].trimStart().startsWith('#')) plain += ` ${lines[i++].trim()}`;
99
+ if (/:\s/.test(plain) || plain.endsWith(':')) problems.push(`${key}: plain value contains ": " which YAML rejects; quote the value`);
100
+ return plain;
101
+ };
102
+ while (i < lines.length) {
103
+ const line = lines[i++];
104
+ if (!line.trim() || line.trimStart().startsWith('#')) continue;
105
+ if (indent(line) > 0) { problems.push(`unexpected indentation: '${line.trim().slice(0, 40)}'`); continue; }
106
+ const match = /^([^:#\s][^:]*?):(?:\s+(.*)|\s*)$/.exec(line);
107
+ if (!match) { problems.push(`not a "key: value" line: '${line.trim().slice(0, 40)}'`); continue; }
108
+ const key = match[1].trim();
109
+ if (Object.hasOwn(data, key)) problems.push(`${key}: duplicate key`);
110
+ data[key] = scalar(match[2] ?? '', key, 0);
111
+ }
112
+ return { data, problems };
113
+ }
114
+
115
+ /** The frontmatter block and body of a SKILL.md, or undefined frontmatter when it has none. */
116
+ export function splitSkill(text) {
117
+ const match = /^?---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(text);
118
+ return match ? { frontmatter: match[1], body: text.slice(match[0].length) } : { frontmatter: undefined, body: text };
119
+ }
120
+
121
+ /**
122
+ * The relative files a Markdown text points to: link targets and code spans naming a resource
123
+ * directory (`references/x.md`). URLs, anchors and template placeholders are skipped.
124
+ */
125
+ export function skillReferences(markdown) {
126
+ const found = new Set();
127
+ const withoutFences = markdown.replace(/^(```|~~~)[\s\S]*?^\1/gm, '');
128
+ for (const match of withoutFences.matchAll(/\]\(\s*<?([^)\s>]+)>?(?:\s+"[^"]*")?\s*\)/g)) found.add(match[1]);
129
+ // A code span is a reference only under references/: `scripts/x` or `templates/` in prose often
130
+ // names a directory of the project the skill works on, so those need a link to be checked.
131
+ for (const match of withoutFences.matchAll(/`([^`\s]+)`/g)) {
132
+ if (/^(?:\.\/)?references\/[^*<>{}$]+\.[a-z0-9]+$/i.test(match[1])) found.add(match[1]);
133
+ }
134
+ return [...found].filter(target => !/^[a-z][\w+.-]*:/i.test(target) && !target.startsWith('#') && !target.startsWith('//'))
135
+ .map(target => { const plain = target.split('#')[0]; try { return decodeURI(plain); } catch { return plain; } }).filter(Boolean);
136
+ }
137
+
138
+ const inside = (root, target) => { const relative = path.relative(root, target); return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative)); };
139
+
140
+ /**
141
+ * Checks frontmatter text against the specification. `directory` is the skill directory's name.
142
+ * @returns {{ data: Record<string, unknown>, findings: Array<{ level: 'error' | 'warning', code: string, message: string }> }}
143
+ */
144
+ export function checkFrontmatter(frontmatter, directory, { strict = false } = {}) {
145
+ const findings = [];
146
+ const format = (code, message) => findings.push({ level: strict ? 'error' : 'warning', code, message });
147
+ const error = (code, message) => findings.push({ level: 'error', code, message });
148
+ const warn = (code, message) => findings.push({ level: 'warning', code, message });
149
+ if (frontmatter === undefined) {
150
+ format('NO_FRONTMATTER', 'SKILL.md has no YAML frontmatter; add "---\\nname: ...\\ndescription: ...\\n---" so agents see what the skill is for');
151
+ return { data: {}, findings };
152
+ }
153
+ const { data, problems } = parseFrontmatter(frontmatter);
154
+ for (const problem of problems) format('YAML', `frontmatter: ${problem}`);
155
+ const { name, description } = data;
156
+ if (name === undefined) format('NAME_MISSING', 'frontmatter has no name');
157
+ else if (typeof name !== 'string' || !specName(name)) format('NAME_FORMAT', `name '${name}' must be 1-${NAME_MAX} lowercase letters, digits and single hyphens, not starting or ending with one`);
158
+ if (typeof name === 'string' && directory !== undefined && name !== directory) format('NAME_DIRECTORY', `name '${name}' differs from its directory '${directory}'; agents find it by the directory name`);
159
+ if (directory !== undefined && !specName(directory)) format('DIRECTORY_NAME', `directory '${directory}' is not a valid skill name; rename it to lowercase letters, digits and hyphens`);
160
+ if (description === undefined || (typeof description === 'string' && !description.trim())) format('DESCRIPTION_MISSING', 'frontmatter has no description: it is all an agent sees before opening the skill');
161
+ else if (typeof description !== 'string') format('DESCRIPTION_FORMAT', 'description must be text');
162
+ else {
163
+ const flat = description.replace(/\s+/g, ' ').trim();
164
+ if (flat.length > DESCRIPTION_MAX) format('DESCRIPTION_LENGTH', `description has ${flat.length} characters; the limit is ${DESCRIPTION_MAX}`);
165
+ else if (flat.length > INDEX_DESCRIPTION_CHARS) warn('DESCRIPTION_CLIPPED', `description has ${flat.length} characters; ALP's skill index shows the first ${INDEX_DESCRIPTION_CHARS}`);
166
+ if (flat.length < 40) warn('DESCRIPTION_SHORT', 'description is under 40 characters; say what the skill does and when to use it');
167
+ if (!TRIGGER_RE.test(flat)) warn('DESCRIPTION_TRIGGER', 'description does not say when to use the skill (for example "Use when ...")');
168
+ if (/[<>]/.test(flat)) format('DESCRIPTION_ANGLE', 'description contains < or >, which some runtimes reject');
169
+ }
170
+ if (data.compatibility !== undefined && (typeof data.compatibility !== 'string' || data.compatibility.length > COMPATIBILITY_MAX)) format('COMPATIBILITY', `compatibility must be text of at most ${COMPATIBILITY_MAX} characters`);
171
+ if (data.license !== undefined && typeof data.license !== 'string') format('LICENSE', 'license must be text');
172
+ if (data['allowed-tools'] !== undefined && typeof data['allowed-tools'] !== 'string') format('ALLOWED_TOOLS', 'allowed-tools must be a space-separated string');
173
+ if (data['allowed-tools'] !== undefined) warn('ALLOWED_TOOLS_ADVISORY', 'allowed-tools is advisory: ALP permissions come from the session mode and permission profiles, never from a skill');
174
+ if (data.metadata !== undefined && (typeof data.metadata !== 'object' || data.metadata === null || Object.values(data.metadata).some(value => typeof value !== 'string'))) format('METADATA', 'metadata must map names to text values');
175
+ for (const key of Object.keys(data)) {
176
+ if (SPEC_KEYS.includes(key)) continue;
177
+ if (RUNTIME_KEYS.includes(key)) format('RUNTIME_KEY', `'${key}' is specific to one runtime; other runtimes ignore it`);
178
+ else format('UNKNOWN_KEY', `unknown frontmatter key '${key}'; the specification allows ${SPEC_KEYS.join(', ')}`);
179
+ }
180
+ return { data, findings };
181
+ }
182
+
183
+ /** Whether a buffer is UTF-8 text without NUL bytes. */
184
+ const isText = buffer => !buffer.includes(0) && Buffer.from(buffer.toString('utf8'), 'utf8').equals(buffer);
185
+
186
+ /**
187
+ * Validates one skill directory.
188
+ * @param {string} directory absolute or relative path of the skill directory
189
+ * @param {{ mode?: 'strict' | 'legacy', shipped?: boolean }} [options] `shipped`: the skill ships in
190
+ * ALP's templates, which bundles carry as UTF-8 text, so every file must be text
191
+ * @returns {Promise<{ name: string, directory: string, mode: 'strict' | 'legacy', ok: boolean, errors: Finding[], warnings: Finding[], files: number }>}
192
+ * @typedef {{ code: string, message: string, file?: string }} Finding
193
+ */
194
+ export async function validateSkill(directory, { mode = 'legacy', shipped = false } = {}) {
195
+ const root = path.resolve(directory);
196
+ const strict = mode === 'strict';
197
+ /** @type {Array<Finding & { level: 'error' | 'warning' }>} */
198
+ const findings = [];
199
+ const add = (level, code, message, file) => findings.push({ level, code, message, ...(file ? { file } : {}) });
200
+ const format = (code, message, file) => add(strict ? 'error' : 'warning', code, message, file);
201
+ const result = () => {
202
+ const errors = findings.filter(f => f.level === 'error').map(({ level, ...f }) => f);
203
+ const warnings = findings.filter(f => f.level === 'warning').map(({ level, ...f }) => f);
204
+ return { name: path.basename(root), directory: root, mode, ok: errors.length === 0, errors, warnings, files };
205
+ };
206
+ let files = 0;
207
+ const info = await lstat(root).catch(() => undefined);
208
+ if (!info) { add('error', 'NOT_FOUND', `no skill directory at ${root}`); return result(); }
209
+ if (info.isSymbolicLink()) add('warning', 'DIRECTORY_LINK', 'the skill directory is a symbolic link; its contents are checked where it points');
210
+ const real = await realpath(root).catch(() => root);
211
+ if (!(await stat(real).then(s => s.isDirectory(), () => false))) { add('error', 'NOT_DIRECTORY', `${root} is not a directory`); return result(); }
212
+
213
+ // Every file under the skill: symlinks must stay inside it; shipped skills must be text.
214
+ const markdown = [];
215
+ let stopped = false;
216
+ const walk = async relative => {
217
+ let entries;
218
+ try { entries = await readdir(path.join(real, relative), { withFileTypes: true }); }
219
+ catch (error) { add('error', 'UNREADABLE', `${relative || '.'} cannot be read: ${error.code ?? error.message}`, relative || undefined); return; }
220
+ for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
221
+ if (stopped) return;
222
+ const rel = path.join(relative, entry.name);
223
+ const full = path.join(real, rel);
224
+ if (++files > MAX_FILES) { stopped = true; add('error', 'TOO_MANY_FILES', `more than ${MAX_FILES} files; a skill should hold instructions and small resources`); return; }
225
+ if (entry.name === 'node_modules' || entry.name === '.git') { add('warning', 'BUNDLED_DEPENDENCIES', `${rel} is bundled; skills must not carry installed dependencies or repositories`, rel); continue; }
226
+ if (entry.isSymbolicLink()) {
227
+ const target = await realpath(full).catch(() => undefined);
228
+ if (target === undefined) add('error', 'BROKEN_SYMLINK', `${rel} is a symbolic link to nothing`, rel);
229
+ else if (!inside(real, target)) add('error', 'UNSAFE_SYMLINK', `${rel} links outside the skill (${target})`, rel);
230
+ else if (shipped) add('error', 'SHIPPED_SYMLINK', `${rel} is a symbolic link; shipped skills hold plain files`, rel);
231
+ continue;
232
+ }
233
+ if (entry.isDirectory()) { await walk(rel); continue; }
234
+ if (!entry.isFile()) { add('error', 'SPECIAL_FILE', `${rel} is not a regular file`, rel); continue; }
235
+ const posix = rel.split(path.sep).join('/');
236
+ if (shipped || posix.endsWith('.md') || posix.startsWith('scripts/')) {
237
+ let buffer;
238
+ try { buffer = await readFile(full); }
239
+ catch (error) { add('error', 'UNREADABLE', `${rel} cannot be read: ${error.code ?? error.message}`, rel); continue; }
240
+ if (shipped && !isText(buffer)) add('error', 'SHIPPED_BINARY', `${rel} is not UTF-8 text; ALP bundles carry shipped skills as text`, rel);
241
+ if (posix.endsWith('.md')) markdown.push([posix, buffer.toString('utf8')]);
242
+ if (posix.startsWith('scripts/') && !shipped && process.platform !== 'win32' && buffer.subarray(0, 2).toString() === '#!' && !((await stat(full)).mode & 0o111)) {
243
+ add('warning', 'SCRIPT_NOT_EXECUTABLE', `${rel} has a #! line but is not executable; run it with its interpreter or chmod +x it`, rel);
244
+ }
245
+ }
246
+ }
247
+ };
248
+ await walk('');
249
+
250
+ const skillFile = markdown.find(([file]) => file === 'SKILL.md');
251
+ if (!skillFile) {
252
+ const other = await readdir(real).then(list => list.find(name => name.toLowerCase() === 'skill.md'), () => undefined);
253
+ add('error', 'SKILL_MD_MISSING', other ? `found ${other}; the file must be named SKILL.md` : 'no SKILL.md');
254
+ return result();
255
+ }
256
+ const { frontmatter, body } = splitSkill(skillFile[1]);
257
+ for (const finding of checkFrontmatter(frontmatter, path.basename(root), { strict }).findings) add(finding.level, finding.code, finding.message, 'SKILL.md');
258
+ if (!body.trim()) format('BODY_EMPTY', 'SKILL.md has no instructions after its frontmatter', 'SKILL.md');
259
+ const lines = body.split('\n').length;
260
+ if (lines > BODY_LINES_RECOMMENDED) add('warning', 'BODY_LONG', `SKILL.md body has ${lines} lines; move detail into references/ (recommended under ${BODY_LINES_RECOMMENDED})`, 'SKILL.md');
261
+
262
+ // References from every Markdown file in the skill, resolved against that file.
263
+ for (const [file, text] of markdown) {
264
+ const content = file === 'SKILL.md' ? body : text;
265
+ for (const target of skillReferences(content)) {
266
+ // A path leaving the skill does not travel with it: an error for new skills, a warning for existing
267
+ // ones (a link to a sibling skill still works where it is). A symlink leaving it is always an error.
268
+ if (path.isAbsolute(target) || /^[a-z]:[\\/]/i.test(target) || target.startsWith('~')) { format('ABSOLUTE_REFERENCE', `${file} names the absolute path ${target}; use a path relative to the skill`, file); continue; }
269
+ const resolved = path.resolve(real, path.dirname(file), target);
270
+ if (!inside(real, resolved)) { format('REFERENCE_OUTSIDE', `${file} points outside the skill: ${target}`, file); continue; }
271
+ const linked = await lstat(resolved).catch(() => undefined);
272
+ if (!linked) { format('BROKEN_REFERENCE', `${file} points to ${target}, which does not exist`, file); continue; }
273
+ if (linked.isSymbolicLink()) {
274
+ const target2 = await realpath(resolved).catch(() => undefined);
275
+ if (!target2 || !inside(real, target2)) add('error', 'REFERENCE_OUTSIDE', `${file} points through a link outside the skill: ${target}`, file);
276
+ }
277
+ }
278
+ }
279
+ return result();
280
+ }
281
+
282
+ /** One line per finding, for a terminal. */
283
+ export function formatValidation(report) {
284
+ const head = `${report.ok ? 'ok ' : 'FAIL'} ${report.name} (${report.mode}) ${report.directory}`;
285
+ const rows = [...report.errors.map(f => ` error ${f.code}: ${f.message}`), ...report.warnings.map(f => ` warning ${f.code}: ${f.message}`)];
286
+ return [head, ...rows].join('\n');
287
+ }
package/src/upgrade.js CHANGED
@@ -14,14 +14,62 @@ const legacy = {
14
14
  };
15
15
  // SHA-256 of shipped role definitions after CRLF normalization. Custom
16
16
  // definitions do not match and remain untouched. Keep historical IDs immutable.
17
+ //
18
+ // A project only receives a new role definition when the copy it holds is listed here, so a version
19
+ // ALP once shipped and never listed is stranded as customInstructions for ever (t-1293). The second
20
+ // block of each list is every distinct content `templates/<file>` ever had in this repository, in
21
+ // commit order, with the commit it first appeared in; the first block is what earlier releases (and
22
+ // the pre-fork Paseo team-v1 lineage) listed by hand. Append only, never edit or remove a line.
23
+ // To extend after changing a template, take the hash of the content being replaced:
24
+ // git show <commit>:templates/agents/supervisor/AGENT.md |
25
+ // node -e 'let d="";process.stdin.setEncoding("utf8").on("data",c=>d+=c).on("end",()=>console.log(require("crypto").createHash("sha256").update(d.replaceAll("\r\n","\n")).digest("hex")))'
17
26
  const teamV1 = {
18
- 'ALP.md': ['c2785aac6538d10e79bd6fb59b11066ccdec77287edf950fad59aa57bf3417f1', '0875293195d35d965effb70bb150d1edbc789f66f72c545f7760dea4346b1a9a'],
19
- '.alp/agents/main/AGENT.md': ['15d217cbc5ede782790d1086124598d9a2b5ff13bcf971a37231962fcef1b47c', 'e7201a1ed7800d7500b5c8091bd8a435aa9d5138f247c2b02b8bf76299387c90', '5001b807bbb686aa1a3b7ecadf9501428909e052e8231281454fd41cbe0ebf27', '90f9903fcc97ddf6336e1a28b81103dddc60a6038dcf74d326be8998862cb022', '9085ab906e2744a4151ae5c63dd66a545115cd4c876be1fd80f0a0ed4e623da8', 'fb55cfb0852d07592090de2c49e6c5c2b57936cbffc823dd24767c2db5e5f7fb'],
20
- '.alp/agents/lead/AGENT.md': ['c259b085a3c102445f97e5c7d402ca68347bcc1a9b02d6ab96e02be6d8b6f9af', '2eef2a4474f757cd89b35b50638a1b23fe49a54c26bf0dedb24a96d7117ddd92', '6c71393c9b3aa655c4731bda96396ea3ec0d4da62cddb3ad50d1a24113416b77', 'a382f0faa724e23a0ba9c212205978aa3fef87c3aecdf8823fba136e04568487', '547e3f8fc354b22c7beb3432182d68f4de1f24938375c8bfb167ae8afbf97de2'],
21
- '.alp/agents/peer/AGENT.md': ['f3dcf16c8c899a5378a468e922ca3956fd72cbb3e3798ed1109f11e01aa8f476', '39ccf3317eba3003faad77ebad4489fae3eb3c4d89258a03f619d1d3d65af0b7', 'c59e45e8f22eb0daca9b8b5e1b19e90666156807f160e75a21eca48b5fee1102', '9623dbf76eda598f6267629e993663c149acb0efd253f3900a4ee1eda8f2f9e7'],
22
- '.alp/agents/oracle/AGENT.md': ['cdce1babcd587a190dc94a32a951ed70ce2c75f99c205a4049df940851ac7059'],
23
- '.alp/agents/reviewer/AGENT.md': ['6eab9f918c79335a0665bf4e3a3a26b66258684d6725c4c95637e70e8d355123'],
27
+ 'ALP.md': ['c2785aac6538d10e79bd6fb59b11066ccdec77287edf950fad59aa57bf3417f1', '0875293195d35d965effb70bb150d1edbc789f66f72c545f7760dea4346b1a9a', 'fe0d5e6f64ef5a5030ee99feaf083f062a8e5136ac52d451e2ca7cdacb21d14f',
28
+ 'e04fe558a26d6e3c9b08211c426a83c368e4f0d15b0929e55df8ab4e5c4bb932', // 61181b5
29
+ 'ff1a7da448b735a9b4f88e3d9b6006d048114d3becee96a331d225b63e453c56', // ca2a971
30
+ '263135a3139eb40501f6e502271e946ec3db4692b63e39c2dd349ac0aaae6d62', // 818ab2e
31
+ 'e855f56ca0af0691c731ac5f2eb93d2528e339f2dbfd6f2376594f878d2c11e1', // 1f827c6
32
+ '48c6a0f80b41958457f8dbaaad7a4b3118efeaf5feb6ae626501c2f7896b077d'], // PR #330 (replaces 83388aa's hash, which never reached main)
33
+ '.alp/agents/main/AGENT.md': ['15d217cbc5ede782790d1086124598d9a2b5ff13bcf971a37231962fcef1b47c', 'e7201a1ed7800d7500b5c8091bd8a435aa9d5138f247c2b02b8bf76299387c90', '5001b807bbb686aa1a3b7ecadf9501428909e052e8231281454fd41cbe0ebf27', '90f9903fcc97ddf6336e1a28b81103dddc60a6038dcf74d326be8998862cb022', '9085ab906e2744a4151ae5c63dd66a545115cd4c876be1fd80f0a0ed4e623da8', 'fb55cfb0852d07592090de2c49e6c5c2b57936cbffc823dd24767c2db5e5f7fb', '91b71f5750e75f707488b70618e1d65a63aabf7518762f97ea0fde999d36fead',
34
+ '60d92fa634e178244a38e99c074e169af1847d7512e268262148ec15ebf08bed', // 61181b5
35
+ 'b501142ebff430e2ac6d0c3ecb2673cbf0fe0e1fa123b73b113ba9b4aa5f3a39', // ca2a971
36
+ 'ddbd75ebacf5f13615fa3da4941a389b14b534742032c3046e0e6c214a46c989', // ec26e6c
37
+ '5d610e7639bc8eaa29ad4119a5c090cbd286bd217f2f4a7d3abdd59725a985c1', // a1acd92
38
+ '28037d678457a392a42510d57919b14a643ea729c2a358fa7aeee4b7a33e6727', // 8d0e12a
39
+ 'b4435cf5ef8cfab2238eee86298f21cfa508e3fdeb6b3e697fde94160c341fe7', // 105f68f
40
+ '973539ce5dd998440cb59938f37260760f96f66a67b66369fcb28421acd49903', // 40ce2de
41
+ 'ab85e561f62a46e8838cc955984b66583a7325e69c1e7f2fd049479241553751', // cc9215e
42
+ '8b8d0bff45d245543f543ecd15043be38fd03edd364c6750aac58b87785c1afa', // 818ab2e
43
+ '2e82f110b108032c3c4444c306e73409bb6b481e5dc9ab080fe1ee2eb583fb78', // b8d2fbc
44
+ 'cde93f41883b26c2ef7636735d88be8fb202b143c479821647799c83b7d673dc', // 9180aa1
45
+ '29f181001edfee5521d8f4965b33f501f8ef869f6af3abf74a05e5f1623809ac', // f4d7986
46
+ 'd6f8002a81e3e0b7bb5868a6834d7be37731cc307877d7a03513067be10cad2f', // 1f827c6
47
+ 'b9bdd073e22903e3813f13caf87c9341215476ed692b3f04bc0971b66fd93ac5'], // 83388aa
48
+ '.alp/agents/lead/AGENT.md': ['c259b085a3c102445f97e5c7d402ca68347bcc1a9b02d6ab96e02be6d8b6f9af', '2eef2a4474f757cd89b35b50638a1b23fe49a54c26bf0dedb24a96d7117ddd92', '6c71393c9b3aa655c4731bda96396ea3ec0d4da62cddb3ad50d1a24113416b77', 'a382f0faa724e23a0ba9c212205978aa3fef87c3aecdf8823fba136e04568487', '547e3f8fc354b22c7beb3432182d68f4de1f24938375c8bfb167ae8afbf97de2', 'f3609df1486c0911459d8ee7d823b344369df0538654b0de6e9bc23170186b22',
49
+ '1674d7b96450824111ce885c828af51aa8924c38888bdeb583f4f31684c2bf60', // 61181b5
50
+ '7cd01a44200fda79ae0979a4975c483494a35e2e8c144b4e56f0b61046fc1a67', // ca2a971
51
+ 'c622392fcb94aeec18efcb12fe9ed574117304af02c303d0f575a2181991b454', // 8d0e12a
52
+ '6e9166b3b72333b76b4b2ef5a7778e142d6fd3c1023efd8a792bec1b12516415', // 40ce2de
53
+ '8aef2591deb1ca12f3cbc843445688140aeb03f7c42bff8e15ef74bdd03be940', // 1f827c6
54
+ 'e241608ee9579ed894024cba8f9b7b60e75283179d68ebbd4cb28a526c78965d'], // 83388aa
55
+ '.alp/agents/peer/AGENT.md': ['f3dcf16c8c899a5378a468e922ca3956fd72cbb3e3798ed1109f11e01aa8f476', '39ccf3317eba3003faad77ebad4489fae3eb3c4d89258a03f619d1d3d65af0b7', 'c59e45e8f22eb0daca9b8b5e1b19e90666156807f160e75a21eca48b5fee1102', '9623dbf76eda598f6267629e993663c149acb0efd253f3900a4ee1eda8f2f9e7', '20b0d2b6be74597ea1f39cf6d2d56c0ef2bffe39cb3bfe1ae41761748ef9bfae',
56
+ 'da389b7fa194fcf4cb8683664d30e06197999d804ec4ee94c1889bb397f540a9', // 61181b5
57
+ 'c7c8f4c5468484bab165f8f32b141398a259d4e6e9966e304528d82858e6807e', // ca2a971
58
+ 'd7cbdac679c82086ce2601d0a2c82480f6b2300ea011a9e07862f1b900d6ac75'], // 1f827c6
59
+ '.alp/agents/oracle/AGENT.md': ['cdce1babcd587a190dc94a32a951ed70ce2c75f99c205a4049df940851ac7059', '0907091b17aa8e54215b65171433f222b8491e9490a16a66b6a2b8cffc3f9023',
60
+ 'ae6219e0141d290705ed45992f0cc78688d17c78757f7f1f72f1639432e110cc'], // 1f827c6
61
+ '.alp/agents/reviewer/AGENT.md': ['6eab9f918c79335a0665bf4e3a3a26b66258684d6725c4c95637e70e8d355123', '1809de0be6473d5f9ceeae2d35128d52a0c0cde3968b45a7569ceae7a8a74416',
62
+ '56bebc192fda9d67bc2ceaf14d4f0cf274eaa40bf3e652caaf85c239eba1a253'], // 1f827c6
63
+ '.alp/agents/supervisor/AGENT.md': ['81ac93f4fbf2337224f838d39a9c4ef13fdba12d5fc7de681a00628bf9e69a27',
64
+ 'a2be7e682b030d2ff122ba4e836b1c89858493a05937fa11ad1fa808e0df9c8d', // 61181b5
65
+ 'd26d642128bedb6c90d4a84b227877ae4ea8be0838de75f40d786c0ba55183ae', // ec26e6c
66
+ 'f920b505cda38c90f7014827352225846b6b1e35a40675e2f5d01b03cee250ce', // cdbc297
67
+ '10e22e451264a901a7ad62e04189a91fae70940a62f4646f22c1135244986d03', // cc9215e
68
+ '6c306170ee5218313c93dc8bc1049e1dd9daf401073fda4c476ff4b5630765ab'], // 1f827c6
24
69
  };
70
+ /** The hashes above, by project-relative path, so a test can hold the list to the templates. */
71
+ export const shippedRoleHashes = teamV1;
72
+
25
73
  /** Profiles' names before 0.4. */
26
74
  const renamedProfiles = { smart: 'pho', supervised: 'cafe' };
27
75
 
package/src/validation.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import { AlpError } from './errors.js';
3
- import { MODELS } from './models.js';
3
+ import { EFFORTS, knownModel } from './models.js';
4
4
  import { validatePermissions } from './permissions.js';
5
5
  import { validateVerify } from './verify.js';
6
6
 
@@ -11,8 +11,6 @@ function requireValue(condition, code, source, message) {
11
11
  if (!condition) throw new AlpError(code, `${source}: ${message}`);
12
12
  }
13
13
 
14
- /** Efforts a profile may name; a model ALP knows takes only its own (src/core/models.js). */
15
- const EFFORTS = ['none', 'off', 'low', 'medium', 'high', 'xhigh', 'max', 'ultra', 'ultracode'];
16
14
  /** Top-level keys of a project's .alp/settings.json. */
17
15
  export const PROJECT_SETTINGS = ['$schema', 'defaultAgent', 'workflow', 'runtime', 'permissions', 'verify', 'delegation', 'team', 'profile', 'templateDefaults', 'compact', 'curate'];
18
16
  /** Top-level keys of the user's $ALP_HOME/settings.json. */
@@ -131,7 +129,8 @@ export function validateSettings(settings, source) {
131
129
  const [provider, model, effort] = entry.split(':');
132
130
  check(model !== '*' || (agent !== 'oracle' && agent !== 'main'), `${at}: ${agent} runs on a named model, not any model`);
133
131
  if (effort !== undefined) {
134
- const known = MODELS.find(candidate => candidate.runtime === provider && candidate.id === model);
132
+ // The live catalog when this process has one (knownModels), else MODELS; never beyond EFFORTS.
133
+ const known = knownModel(`${provider}:${model}`);
135
134
  check(EFFORTS.includes(effort), `${at}: effort ${effort} is unsupported`);
136
135
  check(!known?.efforts.length || known.efforts.includes(effort), `${at}: ${provider}:${model} takes effort ${known?.efforts.join(', ')}`);
137
136
  }
package/templates/ALP.md CHANGED
@@ -1,52 +1,52 @@
1
- # ALP project instructions
2
-
3
- ## Working relationship
4
-
5
- The user communicates with main. The team is fixed for each session:
6
-
7
- - Phở (default): main owns delivery and technical execution; it implements
8
- directly or delegates bounded work to peer. There is no separate lead.
9
- - Cafe: main owns the outcome and supervises lead; lead implements or
10
- delegates to peer. Main routes implementation changes through lead.
11
-
12
- In both, main runs by default on Opus 5.5 with high effort and full access,
13
- and starts a supervisor that reviews the process after each of main's turns.
14
- The supervisor asks main about mistakes; main answers and records lessons it
15
- follows later.
16
-
17
- Oracle provides read-only advice through the configured model lenses; reviewer independently
18
- reviews one diff. Both return once only to the requesting coordinator. They do
19
- not spawn agents. Default maximum concurrent peers is two; raise the configured
20
- limit only at the user's request. Other model and effort choices belong to the
21
- technical coordinator. A role grants no additional filesystem permissions,
22
- credentials, or runtime tools.
23
-
24
- ## Shared work contract
25
-
26
- - Read project instructions and the selected agent's AGENT.md. Load skills only
27
- when needed; do not assume that skills or tools from another runtime exist.
28
- - Each assignment states its objective, root, owned/excluded paths, constraints
29
- and their sources, verification, resources, owner, and expected handoff.
30
- - Keep a single writer per shared checkout. Transfer ownership before main or lead
31
- intervenes in a peer's files. Parallel writers need isolated workspaces and
32
- explicit shared-interface agreements.
33
- - Return artifacts and real verification evidence, with remaining risks. A worker's
34
- completion message is a candidate, not an independent acceptance verdict.
35
- - Review should be independent of authorship: the coordinator reviews peer work;
36
- in Cafe, main reviews lead work. Use reviewer for logic changes and risky
37
- changes, including main-authored changes. Disclose unavailable independent review
38
- rather than claiming it occurred.
39
- - Changes to scope or priorities flow through the technical coordinator's current plan
40
- and the affected peer's revised brief. Direct questions can receive direct answers;
41
- an exceptional intervention must be reconciled with the same shared state.
42
- - Tasks live in `.alp/tasks` and are shared with the user. Only the user and main
43
- create or change them; other agents read them and report work they find to their
44
- requester.
45
- - Use only actual runtime delegation/messaging capabilities. Without them, explain
46
- the limitation, perform authorized work directly where possible, and never claim
47
- that a lead or peer session ran or reviewed anything.
48
-
49
- ## Project-specific constraints
50
-
51
- Add the project's outcome, boundaries, verification commands, and authorization
52
- requirements here. User instructions take precedence over this starter workflow.
1
+ # Hướng dẫn dự án ALP
2
+
3
+ ## Quan hệ làm việc
4
+
5
+ Người dùng (user) trao đổi với main. Team được cố định cho mỗi session:
6
+
7
+ - Phở: main sở hữu việc giao hàng và thực thi kỹ thuật; main tự làm trực tiếp
8
+ hoặc giao việc có giới hạn cho peer. Không có lead riêng.
9
+ - Cafe: main sở hữu kết quả và giám sát lead; lead tự làm hoặc giao việc cho peer. Main đưa
10
+ các thay đổi triển khai đi qua lead.
11
+
12
+ Ở cả hai team, main chạy trên model và effort mà team và `.alp/settings.json` của project
13
+ cấu hình cho nó (template này không cố định chúng), mặc định với toàn quyền truy cập, và
14
+ khởi động một supervisor để review quy trình sau mỗi lượt của main. Supervisor hỏi main về
15
+ các sai sót; main trả lời và ghi lại bài học (lesson) mà sau đó nó phải tuân theo.
16
+
17
+ Oracle đưa lời khuyên chỉ đọc qua các lăng kính model được cấu hình; reviewer review độc lập
18
+ một diff. Cả hai chỉ trả kết quả một lần, và chỉ về cho điều phối viên (coordinator) đã gọi.
19
+ Chúng không sinh thêm agent. Số peer chạy đồng thời tối đa là giới hạn mà instruction
20
+ runtime nêu; chỉ nâng giới hạn đã cấu hình khi người dùng yêu cầu. Các lựa chọn model và
21
+ effort khác thuộc về điều phối viên kỹ thuật. Một role không cấp thêm quyền filesystem,
22
+ credential hay tool runtime nào.
23
+
24
+ ## Hợp đồng làm việc chung
25
+
26
+ - Đọc hướng dẫn dự án và AGENT.md của agent được chọn. Chỉ nạp skill khi cần; đừng mặc định
27
+ rằng skill hay tool của một runtime khác có tồn tại.
28
+ - Mỗi việc được giao (assignment) phải nêu mục tiêu, root, đường dẫn sở hữu/bị loại trừ, các
29
+ ràng buộc và nguồn của chúng, cách kiểm chứng, tài nguyên, người sở hữu, và handoff mong
30
+ đợi.
31
+ - Mỗi checkout dùng chung chỉ giữ một người ghi. Chuyển quyền ghi trước khi main hay lead
32
+ can thiệp vào file của một peer. Nhiều người ghi song song cần workspace tách biệt và thỏa
33
+ thuận rõ ràng về interface dùng chung.
34
+ - Trả về artifact và bằng chứng kiểm chứng thật, kèm những rủi ro còn lại. Thông báo hoàn
35
+ thành của người làm chỉ là một candidate, không phải verdict nghiệm thu độc lập.
36
+ - Review phải độc lập với người viết: điều phối viên review công việc của peer; ở Cafe, main
37
+ review công việc của lead. Dùng reviewer cho thay đổi logic và thay đổi rủi ro, kể cả thay
38
+ đổi do chính main viết. Hãy nói rõ khi không có review độc lập, thay vì nhận rằng đã có.
39
+ - Thay đổi về phạm vi hay ưu tiên phải đi qua kế hoạch hiện tại của điều phối viên kỹ thuật
40
+ và brief đã sửa của peer bị ảnh hưởng. Câu hỏi trực tiếp có thể được trả lời trực tiếp;
41
+ một can thiệp ngoại lệ phải được dung hòa vào cùng trạng thái dùng chung đó.
42
+ - Task nằm trong `.alp/tasks` và được chia sẻ với người dùng. Chỉ người dùng và main tạo hay
43
+ sửa chúng; các agent khác đọc chúng và báo việc chúng tìm thấy cho người giao việc của
44
+ mình.
45
+ - Chỉ dùng năng lực giao việc/gửi tin thật sự có trong runtime. Khi không có, hãy giải thích
46
+ giới hạn đó, tự làm trực tiếp phần việc được phép, và tuyệt đối không nhận rằng một
47
+ session lead hay peer đã chạy hay đã review bất cứ thứ gì.
48
+
49
+ ## Ràng buộc riêng của dự án
50
+
51
+ Thêm kết quả mong muốn, biên giới, các lệnh kiểm chứng và yêu cầu phê duyệt của dự án vào
52
+ đây. Hướng dẫn của người dùng có ưu tiên cao hơn quy trình khởi điểm này.