@ryuenn3123/agentic-senior-core 4.3.15 → 5.1.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/.agents/plugins/marketplace.json +21 -0
- package/.agents/rules/agentic-senior-core.md +126 -0
- package/.claude-plugin/marketplace.json +17 -0
- package/.claude-plugin/plugin.json +17 -0
- package/.clinerules/agentic-senior-core.md +94 -0
- package/.codex-plugin/plugin.json +24 -0
- package/.cursor/rules/agentic-senior-core.mdc +99 -0
- package/.devin-plugin/plugin.json +13 -0
- package/.github/copilot-instructions.md +94 -0
- package/.github/plugin/marketplace.json +20 -0
- package/.github/plugin/plugin.json +16 -0
- package/.kiro/steering/agentic-senior-core.md +94 -0
- package/.openclaw/skills/asc/SKILL.md +23 -0
- package/.openclaw/skills/asc-audit/SKILL.md +28 -0
- package/.openclaw/skills/asc-review/SKILL.md +54 -0
- package/.opencode/plugins/agentic-senior-core.mjs +31 -0
- package/.windsurf/rules/agentic-senior-core.md +94 -0
- package/AGENTS.md +126 -179
- package/CONTRIBUTING.md +93 -63
- package/README.md +160 -111
- package/__init__.py +61 -0
- package/bin/agentic-senior-core.js +41 -43
- package/commands/asc-audit.md +1 -0
- package/commands/asc-audit.toml +2 -0
- package/commands/asc-help.md +9 -0
- package/commands/asc-help.toml +2 -0
- package/commands/asc-refactor.md +1 -0
- package/commands/asc-refactor.toml +2 -0
- package/commands/asc-review.md +1 -0
- package/commands/asc-review.toml +2 -0
- package/gemini-extension.json +10 -0
- package/hooks/copilot-hooks.json +21 -0
- package/hooks/hooks.json +31 -0
- package/hooks/session-start.js +36 -0
- package/hooks/subagent-start.js +38 -0
- package/lib/cli/commands/adapter.mjs +109 -0
- package/lib/cli/commands/clean.mjs +63 -0
- package/lib/cli/commands/status.mjs +94 -0
- package/package.json +43 -67
- package/plugin.yaml +16 -0
- package/scripts/uninstall.js +38 -0
- package/skills/asc/SKILL.md +16 -0
- package/skills/asc-audit/SKILL.md +28 -0
- package/skills/asc-refactor/SKILL.md +35 -0
- package/skills/asc-review/SKILL.md +54 -0
- package/.agent-context/policies/llm-judge-threshold.json +0 -29
- package/.agent-context/prompts/bootstrap-design.md +0 -63
- package/.agent-context/prompts/compact-natural-mode.md +0 -100
- package/.agent-context/prompts/init-project.md +0 -60
- package/.agent-context/prompts/refactor.md +0 -38
- package/.agent-context/prompts/review-code.md +0 -31
- package/.agent-context/review-checklists/architecture-review.md +0 -57
- package/.agent-context/review-checklists/pr-checklist.md +0 -136
- package/.agent-context/rules/api-docs.md +0 -24
- package/.agent-context/rules/api-versioning.md +0 -16
- package/.agent-context/rules/architecture.md +0 -33
- package/.agent-context/rules/background-jobs.md +0 -17
- package/.agent-context/rules/config-and-flags.md +0 -16
- package/.agent-context/rules/database-design.md +0 -18
- package/.agent-context/rules/docker-runtime.md +0 -17
- package/.agent-context/rules/error-handling.md +0 -16
- package/.agent-context/rules/event-driven.md +0 -16
- package/.agent-context/rules/frontend-architecture.md +0 -54
- package/.agent-context/rules/microservices.md +0 -16
- package/.agent-context/rules/migrations.md +0 -16
- package/.agent-context/rules/observability.md +0 -16
- package/.agent-context/rules/performance.md +0 -16
- package/.agent-context/rules/realtime.md +0 -16
- package/.agent-context/rules/resilience.md +0 -18
- package/.agent-context/rules/security.md +0 -18
- package/.agent-context/rules/testing.md +0 -16
- package/.agent-context/state/README.md +0 -25
- package/.agent-context/state/architecture-map.md +0 -40
- package/.agent-context/state/benchmark-comparison-schema.json +0 -181
- package/.agent-context/state/benchmark-reproducibility.json +0 -87
- package/.agent-context/state/benchmark-thresholds.json +0 -10
- package/.agent-context/state/benchmark-writer-judge-config.json +0 -58
- package/.agent-context/state/dependency-map.md +0 -41
- package/.agent-context/state/memory-adapter-contract.json +0 -52
- package/.agent-context/state/memory-schema-v1.json +0 -88
- package/GEMINI.md +0 -1
- package/benchmarks/README.md +0 -60
- package/benchmarks/compact-natural-mode/fixtures.mjs +0 -359
- package/benchmarks/compact-natural-mode/scorer.mjs +0 -331
- package/benchmarks/runtime-token-saver/fixtures.mjs +0 -836
- package/lib/cli/adaptive-context/catalog.mjs +0 -390
- package/lib/cli/adaptive-context/file-signals.mjs +0 -100
- package/lib/cli/adaptive-context/implications.mjs +0 -44
- package/lib/cli/adaptive-context.mjs +0 -365
- package/lib/cli/audits/typography-palette-anti-repeat/color-utils.mjs +0 -156
- package/lib/cli/audits/typography-palette-anti-repeat/file-scanner.mjs +0 -103
- package/lib/cli/audits/typography-palette-anti-repeat/typography-utils.mjs +0 -70
- package/lib/cli/audits/typography-palette-anti-repeat-audit.mjs +0 -239
- package/lib/cli/backup.mjs +0 -210
- package/lib/cli/commands/audit-design-anti-repeat.mjs +0 -39
- package/lib/cli/commands/context.mjs +0 -140
- package/lib/cli/commands/init/project-context.mjs +0 -60
- package/lib/cli/commands/init/runtime-environment.mjs +0 -59
- package/lib/cli/commands/init/setup-decisions.mjs +0 -83
- package/lib/cli/commands/init.mjs +0 -654
- package/lib/cli/commands/launch.mjs +0 -76
- package/lib/cli/commands/optimize.mjs +0 -284
- package/lib/cli/commands/rollback.mjs +0 -64
- package/lib/cli/commands/upgrade/token-optimization-state.mjs +0 -51
- package/lib/cli/commands/upgrade.mjs +0 -451
- package/lib/cli/compiler.mjs +0 -570
- package/lib/cli/constants.mjs +0 -136
- package/lib/cli/detector/constants.mjs +0 -135
- package/lib/cli/detector/design-evidence/collector.mjs +0 -256
- package/lib/cli/detector/design-evidence/constants.mjs +0 -39
- package/lib/cli/detector/design-evidence/file-traversal.mjs +0 -83
- package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +0 -117
- package/lib/cli/detector/design-evidence/summary.mjs +0 -109
- package/lib/cli/detector/design-evidence/utility-helpers.mjs +0 -122
- package/lib/cli/detector/design-evidence.mjs +0 -25
- package/lib/cli/detector/stack-detection.mjs +0 -243
- package/lib/cli/detector/ui-signals.mjs +0 -150
- package/lib/cli/detector/workspace-scan.mjs +0 -177
- package/lib/cli/detector.mjs +0 -23
- package/lib/cli/init-detection-flow.mjs +0 -48
- package/lib/cli/init-options.mjs +0 -237
- package/lib/cli/init-selection.mjs +0 -29
- package/lib/cli/memory-continuity.mjs +0 -537
- package/lib/cli/preflight.mjs +0 -76
- package/lib/cli/project-scaffolder/constants.mjs +0 -69
- package/lib/cli/project-scaffolder/discovery.mjs +0 -272
- package/lib/cli/project-scaffolder/prompt-builders.mjs +0 -171
- package/lib/cli/project-scaffolder/storage.mjs +0 -144
- package/lib/cli/project-scaffolder/ui-scope-detection.mjs +0 -36
- package/lib/cli/project-scaffolder.mjs +0 -29
- package/lib/cli/rollback.mjs +0 -66
- package/lib/cli/token-optimization.mjs +0 -486
- package/lib/cli/utils/filesystem.mjs +0 -81
- package/lib/cli/utils/managed-surface.mjs +0 -280
- package/lib/cli/utils/prompting.mjs +0 -44
- package/lib/cli/utils.mjs +0 -479
- package/mcp.json +0 -134
- package/scripts/adaptive-context/fixtures.mjs +0 -183
- package/scripts/adaptive-context-benchmark.mjs +0 -9
- package/scripts/ascx-runtime-token-saver-benchmark.mjs +0 -9
- package/scripts/audit-cache-layer-contract.mjs +0 -263
- package/scripts/audit-caching-scope-hygiene.mjs +0 -268
- package/scripts/audit-file-size.mjs +0 -219
- package/scripts/audit-reflection-citations.mjs +0 -163
- package/scripts/audit-release-bundle.mjs +0 -170
- package/scripts/audit-rule-id-uniqueness.mjs +0 -313
- package/scripts/audit-typography-palette-anti-repeat.mjs +0 -120
- package/scripts/benchmark-evidence-bundle.mjs +0 -645
- package/scripts/benchmark-gate.mjs +0 -121
- package/scripts/benchmark-intelligence.mjs +0 -33
- package/scripts/benchmark-writer-judge-matrix.mjs +0 -379
- package/scripts/build-release-benchmark-bundle.mjs +0 -202
- package/scripts/bump-version.mjs +0 -103
- package/scripts/clean-local-artifacts.mjs +0 -78
- package/scripts/compact-natural-mode-benchmark.mjs +0 -9
- package/scripts/context-triggered-audit.mjs +0 -391
- package/scripts/detection-benchmark.mjs +0 -127
- package/scripts/docs-quality-drift-report.mjs +0 -358
- package/scripts/documentation-boundary-audit.mjs +0 -305
- package/scripts/explain-on-demand-audit.mjs +0 -427
- package/scripts/forbidden-content-check.mjs +0 -123
- package/scripts/frontend-usability-audit.mjs +0 -243
- package/scripts/generate-sbom.mjs +0 -61
- package/scripts/governance-weekly-report.mjs +0 -466
- package/scripts/llm-judge/checklist-loader.mjs +0 -45
- package/scripts/llm-judge/constants.mjs +0 -66
- package/scripts/llm-judge/diff-collection.mjs +0 -74
- package/scripts/llm-judge/prompting.mjs +0 -78
- package/scripts/llm-judge/providers.mjs +0 -111
- package/scripts/llm-judge/verdict.mjs +0 -134
- package/scripts/llm-judge.mjs +0 -200
- package/scripts/memory-continuity-benchmark.mjs +0 -322
- package/scripts/quality-trend-report.mjs +0 -289
- package/scripts/release-gate/audit-checks.mjs +0 -441
- package/scripts/release-gate/constants.mjs +0 -53
- package/scripts/release-gate/runtime.mjs +0 -63
- package/scripts/release-gate/static-checks.mjs +0 -182
- package/scripts/release-gate.mjs +0 -42
- package/scripts/rules-guardian-audit.mjs +0 -580
- package/scripts/single-source-lazy-loading-audit.mjs +0 -449
- package/scripts/sync-thin-adapters.mjs +0 -72
- package/scripts/token-optimization-benchmark.mjs +0 -252
- package/scripts/ui-design-judge/constants.mjs +0 -13
- package/scripts/ui-design-judge/design-execution-summary.mjs +0 -81
- package/scripts/ui-design-judge/git-input.mjs +0 -134
- package/scripts/ui-design-judge/prompting.mjs +0 -52
- package/scripts/ui-design-judge/providers.mjs +0 -102
- package/scripts/ui-design-judge/reporting.mjs +0 -183
- package/scripts/ui-design-judge/rubric-calibration.mjs +0 -214
- package/scripts/ui-design-judge/rubric-goldset.json +0 -188
- package/scripts/ui-design-judge.mjs +0 -319
- package/scripts/ui-rubric-calibration.mjs +0 -35
- package/scripts/validate/config.mjs +0 -519
- package/scripts/validate/coverage-checks.mjs +0 -446
- package/scripts/validate/file-structure.mjs +0 -162
- package/scripts/validate/markdown-content.mjs +0 -109
- package/scripts/validate/project-metadata.mjs +0 -166
- package/scripts/validate.mjs +0 -338
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ryuenn3123/agentic-senior-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Universal AI coding rules. Write code like a staff engineer, not a junior.",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asc": "bin/agentic-senior-core.js",
|
|
8
8
|
"agentic-senior-core": "bin/agentic-senior-core.js",
|
|
@@ -10,27 +10,34 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"bin/",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"lib/",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
".
|
|
19
|
-
".
|
|
20
|
-
".
|
|
21
|
-
".
|
|
22
|
-
".
|
|
23
|
-
".
|
|
24
|
-
".
|
|
25
|
-
".
|
|
26
|
-
".
|
|
27
|
-
".
|
|
28
|
-
".
|
|
29
|
-
".
|
|
13
|
+
"lib/cli/commands/adapter.mjs",
|
|
14
|
+
"lib/cli/commands/clean.mjs",
|
|
15
|
+
"lib/cli/commands/status.mjs",
|
|
16
|
+
"lib/cli/commands/mcp.mjs",
|
|
17
|
+
"lib/cli/ascx/",
|
|
18
|
+
".claude-plugin/",
|
|
19
|
+
".codex-plugin/",
|
|
20
|
+
".devin-plugin/",
|
|
21
|
+
".github/plugin/",
|
|
22
|
+
".github/copilot-instructions.md",
|
|
23
|
+
".agents/",
|
|
24
|
+
".openclaw/",
|
|
25
|
+
".opencode/",
|
|
26
|
+
".cursor/rules/",
|
|
27
|
+
".windsurf/rules/",
|
|
28
|
+
".clinerules/",
|
|
29
|
+
".kiro/steering/",
|
|
30
|
+
"gemini-extension.json",
|
|
31
|
+
"plugin.yaml",
|
|
32
|
+
"__init__.py",
|
|
33
|
+
"commands/",
|
|
34
|
+
"hooks/",
|
|
35
|
+
"skills/",
|
|
36
|
+
"scripts/mcp-server.mjs",
|
|
37
|
+
"scripts/mcp-server/",
|
|
38
|
+
"scripts/uninstall.js",
|
|
30
39
|
"AGENTS.md",
|
|
31
40
|
"CLAUDE.md",
|
|
32
|
-
"GEMINI.md",
|
|
33
|
-
"mcp.json",
|
|
34
41
|
"README.md",
|
|
35
42
|
"LICENSE",
|
|
36
43
|
"CONTRIBUTING.md"
|
|
@@ -44,58 +51,27 @@
|
|
|
44
51
|
"keywords": [
|
|
45
52
|
"ai",
|
|
46
53
|
"coding-standards",
|
|
47
|
-
"
|
|
54
|
+
"claude-code",
|
|
55
|
+
"codex",
|
|
56
|
+
"cursor",
|
|
48
57
|
"windsurf",
|
|
49
58
|
"copilot",
|
|
50
|
-
"
|
|
59
|
+
"cline",
|
|
60
|
+
"kiro",
|
|
61
|
+
"gemini",
|
|
62
|
+
"devin",
|
|
63
|
+
"hermes",
|
|
64
|
+
"opencode",
|
|
65
|
+
"openclaw",
|
|
66
|
+
"plugin",
|
|
67
|
+
"universal",
|
|
51
68
|
"clean-code",
|
|
52
69
|
"engineering-standards",
|
|
70
|
+
"security",
|
|
71
|
+
"architecture",
|
|
53
72
|
"agentic"
|
|
54
73
|
],
|
|
55
74
|
"scripts": {
|
|
56
|
-
"
|
|
57
|
-
"audit:frontend-usability": "node ./scripts/frontend-usability-audit.mjs",
|
|
58
|
-
"audit:documentation-boundary": "node ./scripts/documentation-boundary-audit.mjs",
|
|
59
|
-
"audit:context-triggered": "node ./scripts/context-triggered-audit.mjs",
|
|
60
|
-
"audit:rules-guardian": "node ./scripts/rules-guardian-audit.mjs",
|
|
61
|
-
"audit:explain-on-demand": "node ./scripts/explain-on-demand-audit.mjs",
|
|
62
|
-
"audit:single-source-lazy-loading": "node ./scripts/single-source-lazy-loading-audit.mjs",
|
|
63
|
-
"audit:cache-layer-contract": "node ./scripts/audit-cache-layer-contract.mjs",
|
|
64
|
-
"audit:reflection-citations": "node ./scripts/audit-reflection-citations.mjs",
|
|
65
|
-
"audit:caching-scope-hygiene": "node ./scripts/audit-caching-scope-hygiene.mjs",
|
|
66
|
-
"audit:typography-palette-anti-repeat": "node ./scripts/audit-typography-palette-anti-repeat.mjs",
|
|
67
|
-
"audit:release-bundle": "node ./scripts/audit-release-bundle.mjs",
|
|
68
|
-
"audit:file-size": "node ./scripts/audit-file-size.mjs",
|
|
69
|
-
"audit:rule-id-uniqueness": "node ./scripts/audit-rule-id-uniqueness.mjs",
|
|
70
|
-
"build:release-bundle": "node ./scripts/build-release-benchmark-bundle.mjs",
|
|
71
|
-
"sync:adapters": "node ./scripts/sync-thin-adapters.mjs",
|
|
72
|
-
"check:adapters": "node ./scripts/sync-thin-adapters.mjs --check",
|
|
73
|
-
"gate:release": "node ./scripts/release-gate.mjs && node ./scripts/forbidden-content-check.mjs",
|
|
74
|
-
"prepublishOnly": "npm run gate:release",
|
|
75
|
-
"sbom:generate": "node ./scripts/generate-sbom.mjs",
|
|
76
|
-
"benchmark:detection": "node ./scripts/detection-benchmark.mjs",
|
|
77
|
-
"benchmark:token": "node ./scripts/token-optimization-benchmark.mjs",
|
|
78
|
-
"benchmark:adaptive-context": "node ./scripts/adaptive-context-benchmark.mjs",
|
|
79
|
-
"benchmark:ascx": "node ./scripts/ascx-runtime-token-saver-benchmark.mjs",
|
|
80
|
-
"benchmark:compact-natural": "node ./scripts/compact-natural-mode-benchmark.mjs",
|
|
81
|
-
"benchmark:bundle": "node ./scripts/benchmark-evidence-bundle.mjs",
|
|
82
|
-
"benchmark:writer-judge": "node ./scripts/benchmark-writer-judge-matrix.mjs",
|
|
83
|
-
"benchmark:gate": "node ./scripts/benchmark-gate.mjs",
|
|
84
|
-
"benchmark:intelligence": "node ./scripts/benchmark-intelligence.mjs",
|
|
85
|
-
"benchmark:continuity": "node ./scripts/memory-continuity-benchmark.mjs",
|
|
86
|
-
"benchmark:cache-phase-2": "node ./benchmarks/token-usage/run-cache-simulation.mjs",
|
|
87
|
-
"benchmark:anti-halu": "node ./benchmarks/anti-halu/run-benchmark.mjs",
|
|
88
|
-
"report:quality-trend": "node ./scripts/quality-trend-report.mjs",
|
|
89
|
-
"report:docs-quality-drift": "node ./scripts/docs-quality-drift-report.mjs",
|
|
90
|
-
"report:governance-weekly": "node ./scripts/governance-weekly-report.mjs",
|
|
91
|
-
"clean:local": "node ./scripts/clean-local-artifacts.mjs",
|
|
92
|
-
"validate": "node ./scripts/validate.mjs",
|
|
93
|
-
"test": "node --test ./tests/cli-smoke.test.mjs ./tests/mcp-server.test.mjs ./tests/llm-judge.test.mjs ./tests/ui-rubric-calibration.test.mjs ./tests/operations.test.mjs ./tests/knowledge-injection.test.mjs ./tests/audit-caching-scope-hygiene.test.mjs ./tests/research-dossier-migration.test.mjs ./tests/typography-palette-anti-repeat-audit.test.mjs ./tests/audit-design-anti-repeat-command.test.mjs ./tests/adaptive-context.test.mjs ./tests/ascx-runtime-token-saver.test.mjs ./tests/compact-natural-mode.test.mjs ./benchmarks/token-usage/lib/token-counter.test.mjs ./benchmarks/token-usage/lib/provider-cache-matrix.test.mjs ./benchmarks/token-usage/lib/cache-layer-contract.test.mjs ./benchmarks/token-usage/lib/cache-economics.test.mjs"
|
|
94
|
-
},
|
|
95
|
-
"devDependencies": {
|
|
96
|
-
"@anthropic-ai/sdk": "^0.96.0",
|
|
97
|
-
"@google/genai": "^2.3.0",
|
|
98
|
-
"tiktoken": "^1.0.22",
|
|
99
|
-
"yaml": "^2.9.0"
|
|
75
|
+
"test": "node --test ./tests/adapter.test.mjs"
|
|
100
76
|
}
|
|
101
77
|
}
|
package/plugin.yaml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: agentic-senior-core
|
|
2
|
+
version: 5.1.0
|
|
3
|
+
description: Universal AI coding rules. Write code like a staff engineer.
|
|
4
|
+
author: fatidaprilian
|
|
5
|
+
provides_hooks:
|
|
6
|
+
- pre_llm_call
|
|
7
|
+
provides_commands:
|
|
8
|
+
- asc-refactor
|
|
9
|
+
- asc-review
|
|
10
|
+
- asc-audit
|
|
11
|
+
- asc-help
|
|
12
|
+
provides_skills:
|
|
13
|
+
- asc
|
|
14
|
+
- asc-refactor
|
|
15
|
+
- asc-review
|
|
16
|
+
- asc-audit
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Uninstall cleanup script.
|
|
4
|
+
* Run this BEFORE removing the plugin from the host, since the host
|
|
5
|
+
* removal deletes the plugin directory (including this script).
|
|
6
|
+
*
|
|
7
|
+
* Cleans up:
|
|
8
|
+
* - Optional config at ~/.config/agentic-senior-core/
|
|
9
|
+
* - StatusLine entries in ~/.claude/settings.json (if any were added)
|
|
10
|
+
*/
|
|
11
|
+
import fs from 'node:fs/promises';
|
|
12
|
+
import path from 'node:path';
|
|
13
|
+
import os from 'node:os';
|
|
14
|
+
|
|
15
|
+
const HOME = os.homedir();
|
|
16
|
+
|
|
17
|
+
async function pathExists(filePath) {
|
|
18
|
+
try {
|
|
19
|
+
await fs.access(filePath);
|
|
20
|
+
return true;
|
|
21
|
+
} catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function main() {
|
|
27
|
+
const configDir = path.join(HOME, '.config', 'agentic-senior-core');
|
|
28
|
+
if (await pathExists(configDir)) {
|
|
29
|
+
await fs.rm(configDir, { recursive: true, force: true });
|
|
30
|
+
console.log(`Removed config directory: ${configDir}`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
console.log('Cleanup complete. You can now remove the plugin from your IDE.');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
main().catch((error) => {
|
|
37
|
+
console.error('Uninstall cleanup failed:', error.message);
|
|
38
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Agentic Senior Core
|
|
2
|
+
|
|
3
|
+
Universal AI coding rules. Write code like a staff engineer.
|
|
4
|
+
|
|
5
|
+
## Available Commands
|
|
6
|
+
|
|
7
|
+
- `/asc-refactor` -- Structured refactoring workflow with pre-checks and validation
|
|
8
|
+
- `/asc-review` -- Production-risk code review with severity-ordered findings
|
|
9
|
+
- `/asc-audit` -- Security and architecture audit
|
|
10
|
+
- `/asc-help` -- Show this help
|
|
11
|
+
|
|
12
|
+
## What It Does
|
|
13
|
+
|
|
14
|
+
Loads universal engineering rules on every session: code quality, architecture, security, error handling, testing, API design, database, frontend, infrastructure, resilience, and async patterns.
|
|
15
|
+
|
|
16
|
+
Rules apply to any project, stack, language, or framework. No per-project configuration needed.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Audit Skill
|
|
2
|
+
|
|
3
|
+
Security and architecture audit. Deeper than review, focused on finding vulnerabilities and structural anti-patterns.
|
|
4
|
+
|
|
5
|
+
## Audit Scope
|
|
6
|
+
|
|
7
|
+
1. **Trust boundaries**: Every point where external input enters the system. Validate that inputs are sanitized, normalized, and rejected when invalid.
|
|
8
|
+
2. **Authentication and authorization**: Verify auth checks exist on every endpoint. Check for resource-level authorization, not just identity.
|
|
9
|
+
3. **Data handling**: Secrets in code or logs, PII exposure, unsafe deserialization, SQL injection, command injection.
|
|
10
|
+
4. **Architecture boundaries**: Business logic in transport layer, shared databases between services, circular dependencies, internal model leakage through public APIs.
|
|
11
|
+
5. **Dependency health**: Known vulnerabilities, unmaintained packages, excessive dependency surface.
|
|
12
|
+
6. **Error exposure**: Stack traces, internal paths, or implementation details exposed to clients.
|
|
13
|
+
|
|
14
|
+
## For Every Finding
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Severity: critical | high | medium | low
|
|
18
|
+
Class: vulnerability class (e.g., SQL Injection, Broken Access Control)
|
|
19
|
+
Location: file:line
|
|
20
|
+
Impact: who or what is affected
|
|
21
|
+
Evidence: exact code, behavior, or command output
|
|
22
|
+
Remediation: specific fix direction
|
|
23
|
+
Validation: how to prove it is fixed
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
Findings ordered by severity. If no findings, state that explicitly and describe audit coverage.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Refactor Skill
|
|
2
|
+
|
|
3
|
+
Structured refactoring workflow. Preserves existing behavior while improving structure.
|
|
4
|
+
|
|
5
|
+
## Before Editing
|
|
6
|
+
|
|
7
|
+
1. Read the target code and understand existing patterns.
|
|
8
|
+
2. Identify the smallest relevant scope for the refactor.
|
|
9
|
+
3. If the change touches UI, check accessibility and responsive behavior.
|
|
10
|
+
4. If the change touches dependencies, verify current official docs.
|
|
11
|
+
|
|
12
|
+
## Refactor Rules
|
|
13
|
+
|
|
14
|
+
- Improve clarity, boundaries, naming, validation, error handling, and tests.
|
|
15
|
+
- Prioritize maintainability over compressed one-liners.
|
|
16
|
+
- Keep the main flow traceable. Use early returns where they reduce nesting.
|
|
17
|
+
- Do not introduce abstractions before the repeated pattern is real.
|
|
18
|
+
- Split large files when the split makes the flow easier to understand.
|
|
19
|
+
- Remove code that does not carry behavior, safety, clarity, maintainability, or test value.
|
|
20
|
+
- Prefer the shorter implementation only when it keeps the same guarantees.
|
|
21
|
+
- Run a final simplification pass before completion.
|
|
22
|
+
- Update tests and docs whenever behavior contracts, public APIs, data shape, or UI contracts change.
|
|
23
|
+
|
|
24
|
+
## For Every Change, Explain
|
|
25
|
+
|
|
26
|
+
- What risk or friction existed.
|
|
27
|
+
- What changed.
|
|
28
|
+
- Why the new shape is safer or easier to maintain.
|
|
29
|
+
|
|
30
|
+
## Validation
|
|
31
|
+
|
|
32
|
+
- Existing behavior is preserved unless the user approved a change.
|
|
33
|
+
- Edge cases, empty states, error paths, and rollback paths are handled.
|
|
34
|
+
- Public contracts remain stable or are versioned.
|
|
35
|
+
- Tests pass.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Review Skill
|
|
2
|
+
|
|
3
|
+
Production-risk code review. Prioritize findings by severity.
|
|
4
|
+
|
|
5
|
+
## Before Reviewing
|
|
6
|
+
|
|
7
|
+
1. Read the changed files and understand the scope.
|
|
8
|
+
2. For UI changes, check accessibility and design consistency.
|
|
9
|
+
3. For API changes, check contract stability and documentation sync.
|
|
10
|
+
|
|
11
|
+
## Finding Priority Order
|
|
12
|
+
|
|
13
|
+
1. Correctness, data loss, security, privacy, auth, and permission risks.
|
|
14
|
+
2. Public contract drift: APIs, events, CLI behavior, data model, UI contract, docs.
|
|
15
|
+
3. Missing tests for changed behavior.
|
|
16
|
+
4. Architecture boundary drift and maintainability risk.
|
|
17
|
+
5. Performance and accessibility issues with concrete impact.
|
|
18
|
+
|
|
19
|
+
## For Every Finding
|
|
20
|
+
|
|
21
|
+
- Include file and line reference.
|
|
22
|
+
- Explain the real risk.
|
|
23
|
+
- Propose the smallest safe fix.
|
|
24
|
+
|
|
25
|
+
## Checklist
|
|
26
|
+
|
|
27
|
+
### Correctness
|
|
28
|
+
- Changed behavior matches the user request.
|
|
29
|
+
- Existing behavior preserved unless user approved a change.
|
|
30
|
+
- Edge cases, empty states, error paths handled.
|
|
31
|
+
|
|
32
|
+
### Security
|
|
33
|
+
- External input validated at trust boundaries.
|
|
34
|
+
- Secrets, tokens, credentials not committed or logged.
|
|
35
|
+
- Authorization enforced at a trusted boundary.
|
|
36
|
+
- Error responses do not leak internals.
|
|
37
|
+
|
|
38
|
+
### Architecture
|
|
39
|
+
- Layer boundaries clear. Controllers do not hold business logic.
|
|
40
|
+
- No premature abstraction. No clever hacks.
|
|
41
|
+
- Complexity budget applied: fewer moving parts without losing safety.
|
|
42
|
+
|
|
43
|
+
### Testing
|
|
44
|
+
- Changed behavior has appropriate tests.
|
|
45
|
+
- Tests assert behavior and contracts, not implementation trivia.
|
|
46
|
+
- Critical flows include failure-path coverage.
|
|
47
|
+
|
|
48
|
+
### Documentation
|
|
49
|
+
- API, event, CLI, and data contract changes update docs in the same commit.
|
|
50
|
+
- Root README exists and stays current.
|
|
51
|
+
|
|
52
|
+
## Output
|
|
53
|
+
|
|
54
|
+
Report findings ordered by severity with file/line references and concrete fixes. If no findings, say so explicitly and name any residual risk.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"selectedProfile": "beginner",
|
|
3
|
-
"profileThresholds": {
|
|
4
|
-
"beginner": {
|
|
5
|
-
"blockingSeverities": [
|
|
6
|
-
"critical"
|
|
7
|
-
],
|
|
8
|
-
"failOnMalformedResponse": false,
|
|
9
|
-
"failOnProviderError": false
|
|
10
|
-
},
|
|
11
|
-
"balanced": {
|
|
12
|
-
"blockingSeverities": [
|
|
13
|
-
"critical",
|
|
14
|
-
"high"
|
|
15
|
-
],
|
|
16
|
-
"failOnMalformedResponse": true,
|
|
17
|
-
"failOnProviderError": false
|
|
18
|
-
},
|
|
19
|
-
"strict": {
|
|
20
|
-
"blockingSeverities": [
|
|
21
|
-
"critical",
|
|
22
|
-
"high",
|
|
23
|
-
"medium"
|
|
24
|
-
],
|
|
25
|
-
"failOnMalformedResponse": true,
|
|
26
|
-
"failOnProviderError": true
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# Design Direction Prompt
|
|
2
|
-
|
|
3
|
-
Use this prompt for UI, UX, frontend layout, screen, or redesign work. Create or refine `docs/DESIGN.md` before writing UI code.
|
|
4
|
-
|
|
5
|
-
## Authority
|
|
6
|
-
|
|
7
|
-
- Use current repo evidence, project docs, and `.agent-context/` as style context.
|
|
8
|
-
- Do not copy layout rhythm, palette, component skin, or brand posture from external references without explicit user approval.
|
|
9
|
-
- WCAG 2.2 AA is the hard compliance floor.
|
|
10
|
-
- When generating any UI component that renders or accepts user data, explicitly state in the prompt: "ensure all user-supplied input is sanitized, all status indicators have non-color alternatives, and all interactive elements have visible focus states."
|
|
11
|
-
- Before choosing a new UI library, research current official docs.
|
|
12
|
-
|
|
13
|
-
## Design Direction Process
|
|
14
|
-
|
|
15
|
-
1. **Name Your Defaults**: Name three temptations (e.g. SaaS admin default, AI-startup landing) and why they flatten this product. Derive your search direction by rejecting them.
|
|
16
|
-
2. **Choose an Anchor**: Run `npx -y getdesign@latest list` to browse proven brand references. Pick one whose spatial rhythm fits this product. Run `npx -y getdesign@latest add <brand>` to read the full reference — use it to derive token values, then discard it. Output DESIGN.md stays under 400 tokens. Do not use generic quality words ("clean", "modern").
|
|
17
|
-
3. **Creative Commitments**: Choose distinctive typography, dominant colors with sharp accents, and one signature motion behavior. Create depth rather than flat card stacks.
|
|
18
|
-
4. **Previous Directions**: If `docs/DESIGN.md` contains previous directions, treat them as a blocklist. The new anchor must differ in conceptual family, hierarchy, and motion.
|
|
19
|
-
|
|
20
|
-
## Redesign Protocol
|
|
21
|
-
|
|
22
|
-
When the user says "redesign from zero": treat existing UI as behavioral evidence only. Rewrite design docs. Change primary composition, hierarchy, interaction model, and responsive architecture. Do not ship a palette swap.
|
|
23
|
-
|
|
24
|
-
## Output Format
|
|
25
|
-
|
|
26
|
-
`docs/DESIGN.md` must be a compact token file under 400 tokens. Rationale stays in working memory.
|
|
27
|
-
|
|
28
|
-
Required sections (in this order, no additions):
|
|
29
|
-
|
|
30
|
-
### Anchor
|
|
31
|
-
One sentence: the interaction anchor and what mechanic is borrowed.
|
|
32
|
-
|
|
33
|
-
### Tokens
|
|
34
|
-
- **Typography**: font families (display, body, mono), scale base and ratio, scale method
|
|
35
|
-
- **Colors**: OKLCH primitives with semantic role mapping (primary, secondary, surface, error, success)
|
|
36
|
-
- **Spacing**: base unit, scale
|
|
37
|
-
- **Radius**: small, medium, large values
|
|
38
|
-
- **Shadow**: elevation levels
|
|
39
|
-
- **Motion**: duration, easing, reduced-motion fallback
|
|
40
|
-
|
|
41
|
-
### Constraints
|
|
42
|
-
- WCAG 2.2 AA floor
|
|
43
|
-
- Up to 3 product-specific anti-patterns
|
|
44
|
-
|
|
45
|
-
### Previous Directions
|
|
46
|
-
Anchors used in prior iterations (blocklist for redesign). Start empty for fresh projects.
|
|
47
|
-
|
|
48
|
-
## Required Validation Gates
|
|
49
|
-
|
|
50
|
-
Only three gates. Do not add more:
|
|
51
|
-
1. Anchor exists and is specific.
|
|
52
|
-
2. Token values are derived from the anchor.
|
|
53
|
-
3. WCAG 2.2 AA compliance floor is met.
|
|
54
|
-
|
|
55
|
-
## Pre-Commit Critique
|
|
56
|
-
|
|
57
|
-
Before committing any UI output, answer:
|
|
58
|
-
|
|
59
|
-
1. Rename test: if the product name changed to an unrelated category, would this UI still look identical? Yes = too generic, reset anchor.
|
|
60
|
-
2. Token drift test: does any color, font, or spacing in the output contradict the DESIGN.md token definitions? Yes = align before commit.
|
|
61
|
-
3. Security test: is user-controlled data rendered unsanitized, or does any status depend on color alone? Yes = fix before merge.
|
|
62
|
-
|
|
63
|
-
Max 3 revision cycles. If unresolved, reset the anchor entirely.
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
# Compact Natural Mode
|
|
2
|
-
|
|
3
|
-
Status: active default response contract.
|
|
4
|
-
|
|
5
|
-
Use this prompt for final user-facing replies after the task-specific rule, prompt, checklist, and validation work is complete.
|
|
6
|
-
|
|
7
|
-
## Purpose
|
|
8
|
-
|
|
9
|
-
Write the smallest complete answer that still lets the next developer act correctly.
|
|
10
|
-
|
|
11
|
-
Compact means high signal. It does not mean broken grammar, dialect, clipped fragments, or hiding evidence.
|
|
12
|
-
|
|
13
|
-
## Always Remove
|
|
14
|
-
|
|
15
|
-
- greetings, affirmations, and repeated restatements
|
|
16
|
-
- narration about what you are about to do
|
|
17
|
-
- generic closing offers
|
|
18
|
-
- padding paragraphs that add no new technical content
|
|
19
|
-
- repeated summaries of the same decision
|
|
20
|
-
|
|
21
|
-
## Always Preserve
|
|
22
|
-
|
|
23
|
-
- exact commands
|
|
24
|
-
- exact file paths and line numbers
|
|
25
|
-
- exact error messages, assertions, exit codes, and stack-trace highlights
|
|
26
|
-
- validation status, including tests not run
|
|
27
|
-
- assumptions, scope qualifiers, blockers, risks, and next actions
|
|
28
|
-
- destructive-operation warnings
|
|
29
|
-
- breaking changes and migration notes
|
|
30
|
-
|
|
31
|
-
## Task Shapes
|
|
32
|
-
|
|
33
|
-
Use natural prose inside these shapes. Omit fields that do not apply, except safety fields.
|
|
34
|
-
|
|
35
|
-
Debug/root cause:
|
|
36
|
-
|
|
37
|
-
```text
|
|
38
|
-
Root Cause: <one sentence>
|
|
39
|
-
Evidence: <exact error, command output, or file:line>
|
|
40
|
-
Fix: <exact command or code direction>
|
|
41
|
-
Next: <verification step>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Test failure:
|
|
45
|
-
|
|
46
|
-
```text
|
|
47
|
-
Failed: <test name>
|
|
48
|
-
Expected/Got: <value> / <value>
|
|
49
|
-
At: <file:line>
|
|
50
|
-
Evidence: <exact assertion or root error>
|
|
51
|
-
Fix direction: <one sentence>
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Code review finding:
|
|
55
|
-
|
|
56
|
-
```text
|
|
57
|
-
[critical|warn|nit] <file>:<line> - <concern>. <requested change>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Implementation/refactor summary:
|
|
61
|
-
|
|
62
|
-
```text
|
|
63
|
-
Changed: <what changed>
|
|
64
|
-
Reason: <why>
|
|
65
|
-
Behavior: <changed, unchanged, or not verified>
|
|
66
|
-
Validation: <what ran or was not run>
|
|
67
|
-
Risk: <only if relevant>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Destructive command:
|
|
71
|
-
|
|
72
|
-
```text
|
|
73
|
-
WARNING: <what this destroys and whether it is reversible>
|
|
74
|
-
Command: <exact command>
|
|
75
|
-
Precondition: <what must be true before running>
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
Security finding:
|
|
79
|
-
|
|
80
|
-
```text
|
|
81
|
-
Severity: <critical|high|medium|low>
|
|
82
|
-
Class: <vulnerability class>
|
|
83
|
-
Location: <file:line>
|
|
84
|
-
Impact: <who or what is affected>
|
|
85
|
-
Evidence: <exact code, behavior, or command output>
|
|
86
|
-
Remediation: <specific fix direction>
|
|
87
|
-
Validation: <how to prove it is fixed>
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Planning/architecture may be longer. Keep decision, rationale, alternatives, tradeoffs, assumptions, and open questions visible.
|
|
91
|
-
|
|
92
|
-
## Second-Pass Check
|
|
93
|
-
|
|
94
|
-
Before finalizing:
|
|
95
|
-
|
|
96
|
-
1. Remove any sentence that adds no new technical content.
|
|
97
|
-
2. Confirm mandatory evidence atoms remain exact.
|
|
98
|
-
3. Confirm assumptions and validation gaps are visible.
|
|
99
|
-
4. Confirm the answer has a decision or next action when the user asked for one.
|
|
100
|
-
5. Confirm the tone is natural professional writing.
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Project Initialization Prompts
|
|
2
|
-
|
|
3
|
-
This prompt boots a repository with strict AI coding guidance context.
|
|
4
|
-
|
|
5
|
-
## System Directives (Auto Execution)
|
|
6
|
-
|
|
7
|
-
When a new project is created or initialized, the agent must automatically:
|
|
8
|
-
1. Read [AGENTS.md](../../AGENTS.md) to understand the canonical bootstrap chain and active entrypoints.
|
|
9
|
-
2. Resolve the smallest relevant rule set from [.agent-context/rules/](../rules/) instead of scanning the whole directory by default.
|
|
10
|
-
3. Review dynamic runtime signals from [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), repository evidence, task constraints, and live official documentation when runtime or ecosystem facts matter.
|
|
11
|
-
4. If Docker or Compose is in scope, load [docker-runtime.md](../rules/docker-runtime.md) and verify the latest official Docker guidance before authoring container assets. Materialize the selected development/production assets rather than stopping at prose.
|
|
12
|
-
5. For unresolved framework or package setup, recommend the latest stable compatible dependency set and official framework setup flow from live official documentation before coding unless a documented compatibility constraint blocks it.
|
|
13
|
-
6. Do not default fresh web projects to Next.js, Tailwind-only styling, shadcn/ui, Vite, or any framework by habit, and do not avoid them because of this guard when they are the strongest fit. Treat explicit user constraints as constraints; otherwise compare project needs, runtime boundaries, hosting, data flow, team workflow, and official setup guidance before recommending.
|
|
14
|
-
|
|
15
|
-
## Required Planning Mode
|
|
16
|
-
|
|
17
|
-
If the user describes a project or feature, the agent must:
|
|
18
|
-
1. Before drafting docs from a thin or ambiguous brief, ask the smallest useful set of clarifying questions needed to make delivery goals, edge cases, constraints, must-have capabilities, and non-goals explicit. If the user wants a draft anyway, document assumptions and wait for approval before coding.
|
|
19
|
-
2. If the user already named a stack or framework, treat it as an explicit constraint. If not, produce a short evidence-backed recommendation from the brief, repo evidence, and live official documentation before coding. Include at least one plausible alternative when the default-looking option is Next.js, Tailwind-only styling, shadcn/ui, or another familiar web stack.
|
|
20
|
-
3. For existing projects, inspect real files first. Do not derive product name, description, runtime, architecture, or design direction from the folder name alone.
|
|
21
|
-
4. Draft a high-level structure plan plus the docs/bootstrap artifacts that must exist before coding.
|
|
22
|
-
5. Wait for user approval before scaffolding the project.
|
|
23
|
-
|
|
24
|
-
## Documentation-First Requests
|
|
25
|
-
|
|
26
|
-
If the user asks to create, complete, fix, or review project docs, documentation, dokumen, `docs/*`, architecture docs, flow docs, API docs, or "lengkapkan docs", treat the request as documentation-first.
|
|
27
|
-
|
|
28
|
-
The agent must:
|
|
29
|
-
1. Materialize or refine required project docs before implementation: root `README.md` for every fresh or existing project; `docs/doc-index.md` whenever `docs/` exists; `docs/project-brief.md`; `docs/architecture-decision-record.md`; `docs/flow-overview.md`; `docs/api-contract.md` when APIs, firmware endpoints, CLI commands, or web application flows exist; `docs/database-schema.md` when persistent data exists; and `docs/DESIGN.md` for UI scope.
|
|
30
|
-
2. Write formal project docs in English by default unless the user explicitly asks for another documentation language.
|
|
31
|
-
3. Keep `docs/doc-index.md` short. Use it as the read-routing map with document path, purpose, reads-when triggers, status, and last-updated date. Do not duplicate the docs it points to.
|
|
32
|
-
4. Keep `README.md` public and developer friendly even for private projects: explain what the project is, who it is for, how to set it up, how to run the core workflow, how to configure it, and where deeper docs live. Do not put internal agent notes, private reasoning, secrets, or governance policy in the README.
|
|
33
|
-
5. Keep documentation alive. When project behavior, setup, architecture, public contracts, data shape, deployment, or UI scope changes, update the matching docs in the same change.
|
|
34
|
-
6. Avoid documentation sprawl. Add a new docs file only when the topic is stable, long enough to outgrow the README or core docs, or owned by a separate workflow such as hardware setup, deployment, troubleshooting, or testing validation.
|
|
35
|
-
7. Add PRD, SRS, technical-design, or separate ERD only when evidence triggers them. Use PRD for product roadmap/user-story ownership, SRS for contractual or multi-stakeholder acceptance criteria, technical-design for non-trivial architecture decisions, and a separate ERD only when `docs/database-schema.md` cannot stay readable with an embedded diagram.
|
|
36
|
-
8. Stop after docs when the user only asked for docs. Do not write application, firmware, or UI code until the user explicitly asks for implementation or approves the implementation plan.
|
|
37
|
-
|
|
38
|
-
## Direct Constraint Mode
|
|
39
|
-
|
|
40
|
-
If the user specifies a framework, runtime, or architecture constraint, the agent must:
|
|
41
|
-
1. Read [AGENTS.md](../../AGENTS.md) for role context.
|
|
42
|
-
2. Resolve only the rules required by the explicit constraint and scope. Do not read unrelated backend, frontend, or DevOps rules by habit.
|
|
43
|
-
3. Reference [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [AGENTS.md](../../AGENTS.md), and the relevant `.agent-context/` files for runtime evidence and any explicit constraints already applied to this project.
|
|
44
|
-
4. Scaffold the initial project structure only after runtime and architecture decisions are explicit:
|
|
45
|
-
- Create only the directories and files justified by the approved structure.
|
|
46
|
-
- Set up configuration, validation, error handling, observability, health checks, and persistence only when they fit the approved runtime and project scope.
|
|
47
|
-
- Every module must follow [architecture.md](../rules/architecture.md).
|
|
48
|
-
- New code must pass the natural implementation pass in [architecture.md](../rules/architecture.md): start with the simplest correct flow, add complexity only when the requirement or repo evidence needs it, and do not add files or layers for small tasks.
|
|
49
|
-
- Use official framework setup commands or canonical starter flows when they produce newer, better-supported dependency defaults than manual package assembly.
|
|
50
|
-
- Do not assemble a framework project from scratch by habit when official setup commands create the supported structure. Manual assembly is allowed only for tiny prototypes, educational demos, unusual repo constraints, or a documented architecture reason.
|
|
51
|
-
- If containerization is selected, Docker assets must follow [docker-runtime.md](../rules/docker-runtime.md) and the latest official Docker docs instead of stale blog-era patterns. Selected Docker lanes require files and runbooks, not docs-only acknowledgment.
|
|
52
|
-
|
|
53
|
-
## Runtime and Architecture Reference
|
|
54
|
-
|
|
55
|
-
See [.agent-context/state/onboarding-report.json](../state/onboarding-report.json), [AGENTS.md](../../AGENTS.md), and the relevant `.agent-context/` files for the latest shipped runtime evidence, explicit constraints, and agent-decision status.
|
|
56
|
-
|
|
57
|
-
## UI/UX Bootstrap
|
|
58
|
-
|
|
59
|
-
When a user requests frontend or UI/UX design, the agent must automatically execute the [bootstrap-design.md](./bootstrap-design.md) prompt to synthesize a dynamic markdown design contract (`docs/DESIGN.md`).
|
|
60
|
-
Keep UI-only requests context-isolated: load [bootstrap-design.md](./bootstrap-design.md) and [frontend-architecture.md](../rules/frontend-architecture.md) first, and do not eagerly load backend-only rules unless the task explicitly crosses backend boundaries.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Prompt: Refactor Code
|
|
2
|
-
|
|
3
|
-
Use this when code needs cleanup, splitting, or safer structure without changing user-visible behavior.
|
|
4
|
-
|
|
5
|
-
```text
|
|
6
|
-
Refactor the target code while preserving existing behavior.
|
|
7
|
-
|
|
8
|
-
Before editing:
|
|
9
|
-
1. Read AGENTS.md and the smallest relevant rules from .agent-context/rules/.
|
|
10
|
-
2. Inspect the real repo conventions before introducing a new structure.
|
|
11
|
-
3. If required project docs are missing, stop and bootstrap or update docs first.
|
|
12
|
-
4. If the change touches UI, load .agent-context/prompts/bootstrap-design.md and .agent-context/rules/frontend-architecture.md before editing.
|
|
13
|
-
5. If the change touches a dependency, framework, Docker, runtime, or ecosystem claim, verify current official docs before choosing.
|
|
14
|
-
6. Enforce Universal SOP hard gate: stop implementation if root `README.md` is missing, if `docs/doc-index.md` is missing while `docs/` exists, if `docs/project-brief.md` is missing, if `docs/architecture-decision-record.md` is missing, if `docs/flow-overview.md` is missing, if `docs/database-schema.md` is missing while the project uses persistent data, if `docs/api-contract.md` is missing while the project exposes API or web application flows, or for UI scope if `docs/DESIGN.md` is missing.
|
|
15
|
-
7. Enforce backend universal principles: no clever hacks, no premature abstraction, readability over brevity.
|
|
16
|
-
8. For backend/API scope, enforce layered boundaries, zero-trust input validation, safe centralized error responses, bounded list reads, transaction safety for multi-write mutations, idempotency for sensitive mutations, and behavior-focused API tests.
|
|
17
|
-
9. Backend/API governance is global and stack-agnostic. Do not create stack-specific adapters or framework-specific rule branches; apply the global rules through the framework already present in the target project.
|
|
18
|
-
10. Enforce the complexity budget: choose fewer moving parts only when behavior, safety, clarity, and maintainability stay intact.
|
|
19
|
-
|
|
20
|
-
Refactor rules:
|
|
21
|
-
- Improve clarity, boundaries, naming, validation, error handling, tests, and docs.
|
|
22
|
-
- Prioritize maintainability over compressed one-liners.
|
|
23
|
-
- Apply the natural implementation pass from architecture.md: keep the main flow traceable, use early returns where they reduce nesting, and avoid helper chains that only make the code look abstract.
|
|
24
|
-
- Do not choose a stack, framework, library, or topology from offline assumptions.
|
|
25
|
-
- Keep module boundaries explicit and project-specific.
|
|
26
|
-
- Split large files when the split makes the flow easier to understand.
|
|
27
|
-
- Do not introduce abstractions before the repeated pattern is real.
|
|
28
|
-
- Remove code that does not carry behavior, safety, clarity, maintainability, or test value.
|
|
29
|
-
- Prefer the shorter implementation only when it keeps the same guarantees.
|
|
30
|
-
- Run a final simplification pass before completion.
|
|
31
|
-
- Update tests and docs whenever behavior contracts, public APIs, data shape, or UI contracts change.
|
|
32
|
-
- When fixing a bug: append one sentence to the nearest relevant doc (`docs/flow-overview.md` or `docs/architecture-decision-record.md`) naming the root cause and how to prevent recurrence.
|
|
33
|
-
|
|
34
|
-
For every meaningful change, explain:
|
|
35
|
-
- what risk or friction existed
|
|
36
|
-
- what changed
|
|
37
|
-
- why the new shape is safer or easier to maintain
|
|
38
|
-
```
|