@urielsh/prodify 0.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/.prodify/AGENTS.md +56 -0
- package/.prodify/README.md +10 -0
- package/.prodify/artifacts/01-understand.md +28 -0
- package/.prodify/artifacts/02-diagnose.md +26 -0
- package/.prodify/artifacts/03-architecture.md +30 -0
- package/.prodify/artifacts/04-plan.md +35 -0
- package/.prodify/artifacts/05-refactor.md +24 -0
- package/.prodify/artifacts/06-validate.md +17 -0
- package/.prodify/artifacts/README.md +6 -0
- package/.prodify/artifacts/architecture_spec.md +29 -0
- package/.prodify/artifacts/artifact-validation-design.md +276 -0
- package/.prodify/artifacts/cli-command-design.md +299 -0
- package/.prodify/artifacts/completed-steps-tracking.md +201 -0
- package/.prodify/artifacts/diagnostic_report.md +45 -0
- package/.prodify/artifacts/hardening-patch-summary.md +57 -0
- package/.prodify/artifacts/hardening-verification-report.md +48 -0
- package/.prodify/artifacts/implementation_summary.md +19 -0
- package/.prodify/artifacts/improvement-evaluation-spec.md +148 -0
- package/.prodify/artifacts/next-step-resolver-design.md +570 -0
- package/.prodify/artifacts/orientation_map.md +32 -0
- package/.prodify/artifacts/persona-removal-audit.md +106 -0
- package/.prodify/artifacts/planning-alignment-report.md +189 -0
- package/.prodify/artifacts/refactor-plan-template-hardening.md +83 -0
- package/.prodify/artifacts/refactor-validate-loop-design.md +231 -0
- package/.prodify/artifacts/refactor_plan.md +21 -0
- package/.prodify/artifacts/refactor_plan.strict-example.md +31 -0
- package/.prodify/artifacts/run-state-design.md +292 -0
- package/.prodify/artifacts/run-summary-spec.md +149 -0
- package/.prodify/artifacts/run_state.json +14 -0
- package/.prodify/artifacts/sample-repo-test-plan.md +129 -0
- package/.prodify/artifacts/status-output-spec.md +349 -0
- package/.prodify/artifacts/step-selection-design.md +251 -0
- package/.prodify/artifacts/task-dispatcher-design.md +266 -0
- package/.prodify/artifacts/task-header-audit.md +42 -0
- package/.prodify/artifacts/task-log-enhancement-spec.md +264 -0
- package/.prodify/artifacts/task-protocol-hardening-plan.md +68 -0
- package/.prodify/artifacts/task-self-validation-spec.md +171 -0
- package/.prodify/artifacts/task_log.json +160 -0
- package/.prodify/artifacts/template-usage-audit.md +20 -0
- package/.prodify/artifacts/validation_report.md +22 -0
- package/.prodify/contracts/README.md +3 -0
- package/.prodify/contracts/architecture.contract.json +42 -0
- package/.prodify/contracts/diagnose.contract.json +42 -0
- package/.prodify/contracts/plan.contract.json +42 -0
- package/.prodify/contracts/refactor.contract.json +45 -0
- package/.prodify/contracts/understand.contract.json +42 -0
- package/.prodify/contracts/validate.contract.json +52 -0
- package/.prodify/contracts-src/README.md +4 -0
- package/.prodify/contracts-src/architecture.contract.md +29 -0
- package/.prodify/contracts-src/diagnose.contract.md +29 -0
- package/.prodify/contracts-src/plan.contract.md +29 -0
- package/.prodify/contracts-src/refactor.contract.md +32 -0
- package/.prodify/contracts-src/understand.contract.md +29 -0
- package/.prodify/contracts-src/validate.contract.md +35 -0
- package/.prodify/metrics/README.md +4 -0
- package/.prodify/planning.md +13 -0
- package/.prodify/project.md +15 -0
- package/.prodify/rules/01-global-operating-rules.md +21 -0
- package/.prodify/rules/02-analysis-discipline.md +17 -0
- package/.prodify/rules/03-diagnosis-severity-rules.md +42 -0
- package/.prodify/rules/04-architecture-rules.md +27 -0
- package/.prodify/rules/05-planning-rules.md +23 -0
- package/.prodify/rules/06-refactor-rules.md +20 -0
- package/.prodify/rules/07-validation-rules.md +25 -0
- package/.prodify/rules/08-output-format-rules.md +20 -0
- package/.prodify/rules/09-template-usage-rules.md +11 -0
- package/.prodify/rules/10-artifact-flow-and-orchestration-rules.md +40 -0
- package/.prodify/rules/README.md +3 -0
- package/.prodify/rules/example-rule.md +4 -0
- package/.prodify/runtime-commands.md +57 -0
- package/.prodify/skills/README.md +8 -0
- package/.prodify/skills/domain/react-frontend.skill.json +34 -0
- package/.prodify/skills/domain/typescript-backend.skill.json +34 -0
- package/.prodify/skills/quality-policy/maintainability-review.skill.json +25 -0
- package/.prodify/skills/quality-policy/security-hardening.skill.json +32 -0
- package/.prodify/skills/quality-policy/test-hardening.skill.json +23 -0
- package/.prodify/skills/registry.json +16 -0
- package/.prodify/skills/stage-method/architecture-method.skill.json +22 -0
- package/.prodify/skills/stage-method/codebase-scanning.skill.json +22 -0
- package/.prodify/skills/stage-method/diagnosis-method.skill.json +22 -0
- package/.prodify/skills/stage-method/planning-method.skill.json +22 -0
- package/.prodify/skills/stage-method/refactoring-method.skill.json +22 -0
- package/.prodify/skills/stage-method/validation-method.skill.json +22 -0
- package/.prodify/state.json +30 -0
- package/.prodify/tasks/01-understand.md +83 -0
- package/.prodify/tasks/02-diagnose.md +67 -0
- package/.prodify/tasks/03-architecture.md +70 -0
- package/.prodify/tasks/04-plan.md +71 -0
- package/.prodify/tasks/05-refactor.md +61 -0
- package/.prodify/tasks/06-validate.md +69 -0
- package/.prodify/tasks/README.md +3 -0
- package/.prodify/tasks/example-task.md +13 -0
- package/.prodify/templates/01-understand.template.md +18 -0
- package/.prodify/templates/02-diagnose.template.md +18 -0
- package/.prodify/templates/03-architecture.template.md +18 -0
- package/.prodify/templates/04-plan.template.md +22 -0
- package/.prodify/templates/05-refactor.template.md +19 -0
- package/.prodify/templates/06-validate.template.md +16 -0
- package/.prodify/templates/README.md +3 -0
- package/.prodify/templates/architecture_spec.template.md +29 -0
- package/.prodify/templates/diagnostic_report.template.md +45 -0
- package/.prodify/templates/example.template.md +5 -0
- package/.prodify/templates/implementation_summary.template.md +19 -0
- package/.prodify/templates/orientation_map.template.md +32 -0
- package/.prodify/templates/refactor_plan.template.md +24 -0
- package/.prodify/templates/validation_report.template.md +22 -0
- package/.prodify/version.json +5 -0
- package/AGENTS.md +305 -0
- package/LICENSE +201 -0
- package/README.md +118 -0
- package/assets/presets/default/canonical/AGENTS.md +54 -0
- package/assets/presets/default/canonical/artifacts/README.md +6 -0
- package/assets/presets/default/canonical/contracts-src/README.md +4 -0
- package/assets/presets/default/canonical/contracts-src/architecture.contract.md +56 -0
- package/assets/presets/default/canonical/contracts-src/diagnose.contract.md +49 -0
- package/assets/presets/default/canonical/contracts-src/plan.contract.md +42 -0
- package/assets/presets/default/canonical/contracts-src/refactor.contract.md +54 -0
- package/assets/presets/default/canonical/contracts-src/understand.contract.md +56 -0
- package/assets/presets/default/canonical/contracts-src/validate.contract.md +64 -0
- package/assets/presets/default/canonical/metrics/README.md +4 -0
- package/assets/presets/default/canonical/planning.md +13 -0
- package/assets/presets/default/canonical/project.md +15 -0
- package/assets/presets/default/canonical/rules/README.md +3 -0
- package/assets/presets/default/canonical/rules/example-rule.md +4 -0
- package/assets/presets/default/canonical/runtime-commands.md +57 -0
- package/assets/presets/default/canonical/skills/README.md +8 -0
- package/assets/presets/default/canonical/skills/domain/react-frontend.skill.json +34 -0
- package/assets/presets/default/canonical/skills/domain/typescript-backend.skill.json +34 -0
- package/assets/presets/default/canonical/skills/quality-policy/maintainability-review.skill.json +25 -0
- package/assets/presets/default/canonical/skills/quality-policy/security-hardening.skill.json +32 -0
- package/assets/presets/default/canonical/skills/quality-policy/test-hardening.skill.json +23 -0
- package/assets/presets/default/canonical/skills/registry.json +16 -0
- package/assets/presets/default/canonical/skills/stage-method/architecture-method.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/codebase-scanning.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/diagnosis-method.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/planning-method.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/refactoring-method.skill.json +22 -0
- package/assets/presets/default/canonical/skills/stage-method/validation-method.skill.json +22 -0
- package/assets/presets/default/canonical/state.json +30 -0
- package/assets/presets/default/canonical/tasks/README.md +3 -0
- package/assets/presets/default/canonical/tasks/example-task.md +13 -0
- package/assets/presets/default/canonical/templates/README.md +3 -0
- package/assets/presets/default/canonical/templates/example.template.md +5 -0
- package/assets/presets/default/preset.json +5 -0
- package/dist/cli.js +53 -0
- package/dist/commands/doctor.js +16 -0
- package/dist/commands/init.js +30 -0
- package/dist/commands/install.js +27 -0
- package/dist/commands/setup-agent.js +23 -0
- package/dist/commands/status.js +28 -0
- package/dist/commands/sync.js +29 -0
- package/dist/commands/update.js +18 -0
- package/dist/contracts/compiled-schema.js +37 -0
- package/dist/contracts/compiler.js +83 -0
- package/dist/contracts/freshness.js +52 -0
- package/dist/contracts/index.js +5 -0
- package/dist/contracts/parser.js +201 -0
- package/dist/contracts/schema.js +138 -0
- package/dist/contracts/source-schema.js +111 -0
- package/dist/core/agent-runtime.js +36 -0
- package/dist/core/agent-setup.js +111 -0
- package/dist/core/doctor.js +155 -0
- package/dist/core/errors.js +19 -0
- package/dist/core/flow-state.js +262 -0
- package/dist/core/fs.js +50 -0
- package/dist/core/install.js +44 -0
- package/dist/core/managed-files.js +106 -0
- package/dist/core/paths.js +56 -0
- package/dist/core/preset-validation.js +43 -0
- package/dist/core/prompt-builder.js +63 -0
- package/dist/core/repo-context.js +77 -0
- package/dist/core/repo-root.js +55 -0
- package/dist/core/skill-resolution.js +123 -0
- package/dist/core/state.js +220 -0
- package/dist/core/status.js +293 -0
- package/dist/core/sync.js +63 -0
- package/dist/core/targets.js +48 -0
- package/dist/core/upgrade.js +57 -0
- package/dist/core/validation.js +138 -0
- package/dist/core/version-checks.js +35 -0
- package/dist/generators/claude.js +14 -0
- package/dist/generators/codex.js +14 -0
- package/dist/generators/copilot.js +29 -0
- package/dist/generators/header.js +13 -0
- package/dist/generators/opencode.js +14 -0
- package/dist/generators/shared.js +37 -0
- package/dist/index.js +9 -0
- package/dist/legacy/targets.js +55 -0
- package/dist/presets/default.js +3 -0
- package/dist/presets/loader.js +34 -0
- package/dist/presets/version.js +18 -0
- package/dist/scoring/model.js +262 -0
- package/dist/skills/loader.js +40 -0
- package/dist/skills/schema.js +159 -0
- package/dist/types.js +1 -0
- package/docs/canonical-prodify-layout.md +87 -0
- package/docs/claude-support.md +22 -0
- package/docs/cli-doctor-spec.md +52 -0
- package/docs/cli-init-spec.md +70 -0
- package/docs/cli-install-agent-spec.md +48 -0
- package/docs/cli-sync-spec.md +40 -0
- package/docs/codex-support.md +24 -0
- package/docs/compatibility-targets.md +59 -0
- package/docs/copilot-support.md +30 -0
- package/docs/default-preset.md +47 -0
- package/docs/generated-file-headers.md +45 -0
- package/docs/generation-rules.md +94 -0
- package/docs/idempotency-guarantees.md +31 -0
- package/docs/managed-file-detection.md +45 -0
- package/docs/manual-edit-conflicts.md +37 -0
- package/docs/opencode-support.md +27 -0
- package/docs/ownership-rules.md +39 -0
- package/docs/path-resolution-rules.md +40 -0
- package/docs/preset-structure.md +49 -0
- package/docs/skill-system.md +67 -0
- package/docs/versioning-and-upgrade-strategy.md +40 -0
- package/package.json +22 -0
- package/src/README.md +11 -0
- package/src/cli.ts +61 -0
- package/src/commands/doctor.ts +20 -0
- package/src/commands/init.ts +37 -0
- package/src/commands/setup-agent.ts +28 -0
- package/src/commands/status.ts +34 -0
- package/src/commands/update.ts +23 -0
- package/src/contracts/README.md +10 -0
- package/src/contracts/compiled-schema.ts +42 -0
- package/src/contracts/compiler.ts +111 -0
- package/src/contracts/freshness.ts +58 -0
- package/src/contracts/index.ts +11 -0
- package/src/contracts/parser.ts +253 -0
- package/src/contracts/source-schema.ts +141 -0
- package/src/core/agent-runtime.ts +53 -0
- package/src/core/agent-setup.ts +147 -0
- package/src/core/doctor.ts +171 -0
- package/src/core/errors.ts +28 -0
- package/src/core/flow-state.ts +333 -0
- package/src/core/fs.ts +59 -0
- package/src/core/paths.ts +63 -0
- package/src/core/preset-validation.ts +47 -0
- package/src/core/prompt-builder.ts +73 -0
- package/src/core/repo-context.ts +93 -0
- package/src/core/repo-root.ts +74 -0
- package/src/core/skill-resolution.ts +151 -0
- package/src/core/state.ts +264 -0
- package/src/core/status.ts +372 -0
- package/src/core/targets.ts +53 -0
- package/src/core/upgrade.ts +66 -0
- package/src/core/validation.ts +233 -0
- package/src/core/version-checks.ts +40 -0
- package/src/index.ts +13 -0
- package/src/presets/default.ts +7 -0
- package/src/presets/loader.ts +46 -0
- package/src/presets/version.ts +31 -0
- package/src/scoring/model.ts +332 -0
- package/src/skills/loader.ts +58 -0
- package/src/skills/schema.ts +197 -0
- package/src/types.ts +329 -0
- package/tests/integration/cli-flows.test.js +347 -0
- package/tests/unit/agent-setup.test.js +81 -0
- package/tests/unit/cli.test.js +28 -0
- package/tests/unit/contracts.test.js +61 -0
- package/tests/unit/helpers.js +28 -0
- package/tests/unit/paths.test.js +52 -0
- package/tests/unit/preset-loader.test.js +37 -0
- package/tests/unit/scoring.test.js +65 -0
- package/tests/unit/self-hosted-workspace.test.js +22 -0
- package/tests/unit/skills.test.js +115 -0
- package/tests/unit/state-and-flow.test.js +120 -0
- package/tests/unit/targets.test.js +13 -0
- package/tests/unit/validation.test.js +73 -0
- package/tests/unit/version.test.js +24 -0
- package/tsconfig.json +23 -0
- package/urielsh-prodify-0.1.0.tgz +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
contract_version: 1.0.0
|
|
4
|
+
stage: validate
|
|
5
|
+
task_id: 06-validate
|
|
6
|
+
required_artifacts:
|
|
7
|
+
- path: .prodify/artifacts/06-validate.md
|
|
8
|
+
format: markdown
|
|
9
|
+
required_sections:
|
|
10
|
+
- Policy Checks
|
|
11
|
+
- Regressions
|
|
12
|
+
- Success Criteria
|
|
13
|
+
- Validation Results
|
|
14
|
+
- path: .prodify/state.json
|
|
15
|
+
format: json
|
|
16
|
+
required_json_keys:
|
|
17
|
+
- preset_name
|
|
18
|
+
- preset_version
|
|
19
|
+
- runtime
|
|
20
|
+
- schema_version
|
|
21
|
+
allowed_write_roots:
|
|
22
|
+
- .prodify/artifacts/
|
|
23
|
+
- .prodify/metrics/
|
|
24
|
+
forbidden_writes:
|
|
25
|
+
- src/
|
|
26
|
+
policy_rules:
|
|
27
|
+
- Validation must follow every refactor step.
|
|
28
|
+
- Critical regressions block forward progress.
|
|
29
|
+
success_criteria:
|
|
30
|
+
- Validation records whether regressions were found.
|
|
31
|
+
- The result is strong enough to gate the next runtime transition.
|
|
32
|
+
skill_routing:
|
|
33
|
+
default_skills:
|
|
34
|
+
- test-hardening
|
|
35
|
+
- validation-method
|
|
36
|
+
allowed_skills:
|
|
37
|
+
- react-frontend
|
|
38
|
+
- security-hardening
|
|
39
|
+
- test-hardening
|
|
40
|
+
- typescript-backend
|
|
41
|
+
- validation-method
|
|
42
|
+
conditional_skills:
|
|
43
|
+
- skill: react-frontend
|
|
44
|
+
when:
|
|
45
|
+
all:
|
|
46
|
+
- fact: framework
|
|
47
|
+
includes: react
|
|
48
|
+
reason: repo framework includes React
|
|
49
|
+
- skill: security-hardening
|
|
50
|
+
when:
|
|
51
|
+
all:
|
|
52
|
+
- fact: risk_signal
|
|
53
|
+
includes: external-dependencies
|
|
54
|
+
reason: repo carries external dependency risk
|
|
55
|
+
- skill: typescript-backend
|
|
56
|
+
when:
|
|
57
|
+
all:
|
|
58
|
+
- fact: language
|
|
59
|
+
includes: typescript
|
|
60
|
+
reason: repo language includes TypeScript
|
|
61
|
+
---
|
|
62
|
+
# Validate Contract
|
|
63
|
+
|
|
64
|
+
Use this contract to record validation evidence, regression status, and final readiness for the next state transition.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Project
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Describe the repository purpose here.
|
|
6
|
+
|
|
7
|
+
## Goals
|
|
8
|
+
|
|
9
|
+
- Capture project goals.
|
|
10
|
+
- Record constraints and conventions.
|
|
11
|
+
|
|
12
|
+
## Agent Bootstrap
|
|
13
|
+
|
|
14
|
+
- The user starts by telling the agent to read `.prodify/AGENTS.md`.
|
|
15
|
+
- The main Prodify flow should stay inside `.prodify/`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Runtime Commands
|
|
2
|
+
|
|
3
|
+
Run these commands inside your coding agent after `prodify init`.
|
|
4
|
+
If this machine has not been prepared for that agent yet, run `prodify setup-agent <agent>` outside the repo first.
|
|
5
|
+
|
|
6
|
+
## Manual Bootstrap
|
|
7
|
+
|
|
8
|
+
- First tell the agent: `Read .prodify/AGENTS.md and bootstrap Prodify for this repository.`
|
|
9
|
+
- Keep the run anchored to `.prodify/AGENTS.md`, `.prodify/project.md`, `.prodify/planning.md`, `.prodify/contracts-src/`, `.prodify/contracts/`, `.prodify/skills/`, `.prodify/artifacts/`, `.prodify/metrics/`, `.prodify/tasks/`, and `.prodify/state.json`.
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
- `$prodify-init`
|
|
14
|
+
- inspect `.prodify/`
|
|
15
|
+
- detect or resolve the active agent/runtime mode
|
|
16
|
+
- initialize `.prodify/state.json`
|
|
17
|
+
- prepare the bootstrapped state and the `understand` contract without locking the repo to one agent
|
|
18
|
+
|
|
19
|
+
- `$prodify-execute`
|
|
20
|
+
- run one workflow stage
|
|
21
|
+
- write stage artifacts under `.prodify/artifacts/`
|
|
22
|
+
- validate the stage against the compiled contract JSON
|
|
23
|
+
- update runtime state after the validation result
|
|
24
|
+
- pause for validation checkpoints between stages in interactive mode
|
|
25
|
+
|
|
26
|
+
- `$prodify-execute --auto`
|
|
27
|
+
- continue across stages without pausing
|
|
28
|
+
- stop only on hard failure, policy block, required approval threshold, or invalid state
|
|
29
|
+
|
|
30
|
+
- `$prodify-resume`
|
|
31
|
+
- continue from `.prodify/state.json`
|
|
32
|
+
- preserve validation checkpoints
|
|
33
|
+
- fail clearly if the state is corrupt or non-resumable
|
|
34
|
+
|
|
35
|
+
## Supported Runtime Profiles
|
|
36
|
+
|
|
37
|
+
- Codex
|
|
38
|
+
- Claude
|
|
39
|
+
- Copilot
|
|
40
|
+
- OpenCode
|
|
41
|
+
|
|
42
|
+
## Stage Order
|
|
43
|
+
|
|
44
|
+
- `understand`
|
|
45
|
+
- `diagnose`
|
|
46
|
+
- `architecture`
|
|
47
|
+
- `plan`
|
|
48
|
+
- `refactor`
|
|
49
|
+
- `validate`
|
|
50
|
+
|
|
51
|
+
## Contract Rules
|
|
52
|
+
|
|
53
|
+
- Source contracts live under `.prodify/contracts-src/*.contract.md`.
|
|
54
|
+
- Runtime execution reads only `.prodify/contracts/*.contract.json`.
|
|
55
|
+
- Skill definitions live under `.prodify/skills/*.json`.
|
|
56
|
+
- Stage skill routing can activate bounded skills per stage, but contracts and validators remain authoritative.
|
|
57
|
+
- Stage completion is gated by compiled-contract validation, not by agent assertion alone.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Skills
|
|
2
|
+
|
|
3
|
+
This directory contains the product-owned skill registry for deterministic stage execution.
|
|
4
|
+
|
|
5
|
+
- `registry.json` is the manifest and source of truth for discoverable skills.
|
|
6
|
+
- Each `*.skill.json` file defines one bounded skill.
|
|
7
|
+
- Contracts may reference skills only through explicit `skill_routing`.
|
|
8
|
+
- Skills can improve execution quality, but they never override compiled contracts or validation.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "react-frontend",
|
|
4
|
+
"name": "React Frontend",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "domain",
|
|
7
|
+
"description": "Provides React-specific implementation and review guidance when a React surface is detected.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use in understand, architecture, refactor, and validate when the repo framework includes React."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"architecture",
|
|
13
|
+
"refactor",
|
|
14
|
+
"understand",
|
|
15
|
+
"validate"
|
|
16
|
+
],
|
|
17
|
+
"activation_conditions": [
|
|
18
|
+
{
|
|
19
|
+
"all": [
|
|
20
|
+
{
|
|
21
|
+
"fact": "framework",
|
|
22
|
+
"includes": "react"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"execution_guidance": [
|
|
28
|
+
"Preserve component boundaries and data-flow clarity.",
|
|
29
|
+
"Keep framework-specific advice subordinate to stage contracts."
|
|
30
|
+
],
|
|
31
|
+
"caution_guidance": [
|
|
32
|
+
"Do not assume a frontend repo unless React evidence is present."
|
|
33
|
+
]
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "typescript-backend",
|
|
4
|
+
"name": "TypeScript Backend",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "domain",
|
|
7
|
+
"description": "Applies TypeScript service and CLI implementation guidance when the repository is TypeScript-based.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use in architecture, refactor, and validate when the repo language includes TypeScript."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"architecture",
|
|
13
|
+
"refactor",
|
|
14
|
+
"understand",
|
|
15
|
+
"validate"
|
|
16
|
+
],
|
|
17
|
+
"activation_conditions": [
|
|
18
|
+
{
|
|
19
|
+
"all": [
|
|
20
|
+
{
|
|
21
|
+
"fact": "language",
|
|
22
|
+
"includes": "typescript"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"execution_guidance": [
|
|
28
|
+
"Prefer type-safe interfaces and explicit runtime-state normalization.",
|
|
29
|
+
"Keep generated JavaScript output aligned with TypeScript sources."
|
|
30
|
+
],
|
|
31
|
+
"caution_guidance": [
|
|
32
|
+
"Do not rely on implicit any-style assumptions when shaping refactors."
|
|
33
|
+
]
|
|
34
|
+
}
|
package/assets/presets/default/canonical/skills/quality-policy/maintainability-review.skill.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "maintainability-review",
|
|
4
|
+
"name": "Maintainability Review",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "quality-policy",
|
|
7
|
+
"description": "Highlights readability, ownership, and long-term support risks without redefining success criteria.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use in diagnose, architecture, and plan when maintainability concerns are relevant."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"architecture",
|
|
13
|
+
"diagnose",
|
|
14
|
+
"plan",
|
|
15
|
+
"understand"
|
|
16
|
+
],
|
|
17
|
+
"activation_conditions": [],
|
|
18
|
+
"execution_guidance": [
|
|
19
|
+
"Call out mixed concerns and unclear ownership paths.",
|
|
20
|
+
"Prefer small, explainable structure improvements."
|
|
21
|
+
],
|
|
22
|
+
"caution_guidance": [
|
|
23
|
+
"Do not replace contract validation with style preference."
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "security-hardening",
|
|
4
|
+
"name": "Security Hardening",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "quality-policy",
|
|
7
|
+
"description": "Applies explicit scrutiny when the repository has exposed surfaces or dependency risk signals.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use in diagnose and validate when risk signals suggest stronger security review."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"diagnose",
|
|
13
|
+
"validate"
|
|
14
|
+
],
|
|
15
|
+
"activation_conditions": [
|
|
16
|
+
{
|
|
17
|
+
"all": [
|
|
18
|
+
{
|
|
19
|
+
"fact": "risk_signal",
|
|
20
|
+
"includes": "external-dependencies"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"execution_guidance": [
|
|
26
|
+
"Check exposed command or network surfaces before declaring validation success.",
|
|
27
|
+
"Treat dependency-driven risk as additive evidence, not a blocker by itself."
|
|
28
|
+
],
|
|
29
|
+
"caution_guidance": [
|
|
30
|
+
"Do not infer a security defect without repository evidence."
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "test-hardening",
|
|
4
|
+
"name": "Test Hardening",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "quality-policy",
|
|
7
|
+
"description": "Improves confidence through regression-focused test additions or validation checks.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use in refactor and validate when executable checks should be strengthened."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"refactor",
|
|
13
|
+
"validate"
|
|
14
|
+
],
|
|
15
|
+
"activation_conditions": [],
|
|
16
|
+
"execution_guidance": [
|
|
17
|
+
"Add or strengthen tests around the selected behavior change boundary.",
|
|
18
|
+
"Prefer deterministic assertions over snapshot-like broad checks."
|
|
19
|
+
],
|
|
20
|
+
"caution_guidance": [
|
|
21
|
+
"Do not add unrelated test churn outside the selected step."
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"skills": [
|
|
4
|
+
"domain/react-frontend.skill.json",
|
|
5
|
+
"domain/typescript-backend.skill.json",
|
|
6
|
+
"quality-policy/maintainability-review.skill.json",
|
|
7
|
+
"quality-policy/security-hardening.skill.json",
|
|
8
|
+
"quality-policy/test-hardening.skill.json",
|
|
9
|
+
"stage-method/architecture-method.skill.json",
|
|
10
|
+
"stage-method/codebase-scanning.skill.json",
|
|
11
|
+
"stage-method/diagnosis-method.skill.json",
|
|
12
|
+
"stage-method/planning-method.skill.json",
|
|
13
|
+
"stage-method/refactoring-method.skill.json",
|
|
14
|
+
"stage-method/validation-method.skill.json"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "architecture-method",
|
|
4
|
+
"name": "Architecture Method",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "stage-method",
|
|
7
|
+
"description": "Focuses architecture work on boundaries, dependency direction, and modular responsibility splits.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use during architecture to propose structural changes that preserve the contract model."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"architecture"
|
|
13
|
+
],
|
|
14
|
+
"activation_conditions": [],
|
|
15
|
+
"execution_guidance": [
|
|
16
|
+
"Describe boundaries before proposing new modules or layers.",
|
|
17
|
+
"Flag mixed concerns and outward domain dependencies explicitly."
|
|
18
|
+
],
|
|
19
|
+
"caution_guidance": [
|
|
20
|
+
"Do not treat architecture guidance as permission to rewrite unrelated code."
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "codebase-scanning",
|
|
4
|
+
"name": "Codebase Scanning",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "stage-method",
|
|
7
|
+
"description": "Guides the understand stage toward deterministic inventory, dependency, and ownership mapping.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use during understand to scan the repository surface before drawing conclusions."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"understand"
|
|
13
|
+
],
|
|
14
|
+
"activation_conditions": [],
|
|
15
|
+
"execution_guidance": [
|
|
16
|
+
"Inventory verified files and directories before summarizing the repository.",
|
|
17
|
+
"Prefer direct evidence over inferred structure."
|
|
18
|
+
],
|
|
19
|
+
"caution_guidance": [
|
|
20
|
+
"Do not speculate about missing modules or undocumented ownership."
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "diagnosis-method",
|
|
4
|
+
"name": "Diagnosis Method",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "stage-method",
|
|
7
|
+
"description": "Keeps diagnosis anchored to observed evidence, root causes, and production-readiness risks.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use during diagnose to separate symptoms, causes, and unsupported claims."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"diagnose"
|
|
13
|
+
],
|
|
14
|
+
"activation_conditions": [],
|
|
15
|
+
"execution_guidance": [
|
|
16
|
+
"Tie every issue to observable evidence.",
|
|
17
|
+
"Separate root causes from downstream symptoms."
|
|
18
|
+
],
|
|
19
|
+
"caution_guidance": [
|
|
20
|
+
"Do not prescribe implementation changes in the diagnosis stage."
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "planning-method",
|
|
4
|
+
"name": "Planning Method",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "stage-method",
|
|
7
|
+
"description": "Shapes implementation plans into bounded, testable, behavior-preserving steps.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use during plan to convert diagnosis and architecture outputs into ordered steps."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"plan"
|
|
13
|
+
],
|
|
14
|
+
"activation_conditions": [],
|
|
15
|
+
"execution_guidance": [
|
|
16
|
+
"Keep steps small, testable, and directly linked to diagnosed issues.",
|
|
17
|
+
"Call out guardrails when behavior must remain stable."
|
|
18
|
+
],
|
|
19
|
+
"caution_guidance": [
|
|
20
|
+
"Do not introduce implementation detail that belongs in refactor."
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "refactoring-method",
|
|
4
|
+
"name": "Refactoring Method",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "stage-method",
|
|
7
|
+
"description": "Keeps refactor work bounded to a single selected step with minimal diff discipline.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use during refactor when implementing one approved plan step."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"refactor"
|
|
13
|
+
],
|
|
14
|
+
"activation_conditions": [],
|
|
15
|
+
"execution_guidance": [
|
|
16
|
+
"Implement one planned step at a time.",
|
|
17
|
+
"Preserve behavior unless the plan explicitly authorizes a change."
|
|
18
|
+
],
|
|
19
|
+
"caution_guidance": [
|
|
20
|
+
"Do not expand the edit set beyond the selected step."
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1",
|
|
3
|
+
"id": "validation-method",
|
|
4
|
+
"name": "Validation Method",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"category": "stage-method",
|
|
7
|
+
"description": "Ensures validation checks regressions, contract conformance, and structural improvements explicitly.",
|
|
8
|
+
"intended_use": [
|
|
9
|
+
"Use during validate to assess pass or fail after refactor work."
|
|
10
|
+
],
|
|
11
|
+
"stage_compatibility": [
|
|
12
|
+
"validate"
|
|
13
|
+
],
|
|
14
|
+
"activation_conditions": [],
|
|
15
|
+
"execution_guidance": [
|
|
16
|
+
"Check contract conformance before interpreting broader quality signals.",
|
|
17
|
+
"Record regressions and architecture violations explicitly."
|
|
18
|
+
],
|
|
19
|
+
"caution_guidance": [
|
|
20
|
+
"Do not treat validation as optional after refactor."
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "2",
|
|
3
|
+
"preset_name": "default",
|
|
4
|
+
"preset_version": "4.0.0",
|
|
5
|
+
"runtime": {
|
|
6
|
+
"status": "not_bootstrapped",
|
|
7
|
+
"current_state": "not_bootstrapped",
|
|
8
|
+
"mode": null,
|
|
9
|
+
"current_stage": null,
|
|
10
|
+
"current_task_id": null,
|
|
11
|
+
"pending_stage": null,
|
|
12
|
+
"completed_stages": [],
|
|
13
|
+
"awaiting_user_validation": false,
|
|
14
|
+
"last_validation_result": "unknown",
|
|
15
|
+
"last_validation": null,
|
|
16
|
+
"last_validated_contract_versions": {},
|
|
17
|
+
"resumable": false,
|
|
18
|
+
"blocked_reason": null,
|
|
19
|
+
"failure_metadata": null,
|
|
20
|
+
"bootstrap": {
|
|
21
|
+
"bootstrapped": false
|
|
22
|
+
},
|
|
23
|
+
"next_action": "$prodify-init",
|
|
24
|
+
"timestamps": {
|
|
25
|
+
"bootstrapped_at": null,
|
|
26
|
+
"last_transition_at": null,
|
|
27
|
+
"completed_at": null
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { runDoctorCommand } from './commands/doctor.js';
|
|
2
|
+
import { runInitCommand } from './commands/init.js';
|
|
3
|
+
import { runSetupAgentCommand } from './commands/setup-agent.js';
|
|
4
|
+
import { runStatusCommand } from './commands/status.js';
|
|
5
|
+
import { runUpdateCommand } from './commands/update.js';
|
|
6
|
+
import { ProdifyError, toErrorMessage } from './core/errors.js';
|
|
7
|
+
export const COMMANDS = {
|
|
8
|
+
init: runInitCommand,
|
|
9
|
+
'setup-agent': runSetupAgentCommand,
|
|
10
|
+
status: runStatusCommand,
|
|
11
|
+
doctor: runDoctorCommand,
|
|
12
|
+
update: runUpdateCommand
|
|
13
|
+
};
|
|
14
|
+
export const PUBLIC_COMMANDS = ['init', 'setup-agent', 'status', 'doctor', 'update'];
|
|
15
|
+
export function renderHelp() {
|
|
16
|
+
return [
|
|
17
|
+
'Prodify CLI',
|
|
18
|
+
'',
|
|
19
|
+
'Usage:',
|
|
20
|
+
' prodify setup-agent <codex|claude|copilot|opencode>',
|
|
21
|
+
' prodify init',
|
|
22
|
+
' prodify status',
|
|
23
|
+
' prodify doctor',
|
|
24
|
+
' prodify update',
|
|
25
|
+
'',
|
|
26
|
+
'Global agent setup is separate from per-repository init.',
|
|
27
|
+
'The primary flow is .prodify-first and contract-driven.'
|
|
28
|
+
].join('\n');
|
|
29
|
+
}
|
|
30
|
+
export async function runCli(argv, context = {}) {
|
|
31
|
+
const stdout = context.stdout ?? process.stdout;
|
|
32
|
+
const stderr = context.stderr ?? process.stderr;
|
|
33
|
+
const cwd = context.cwd ?? process.cwd();
|
|
34
|
+
if (argv.length === 0 || argv.includes('--help') || argv.includes('-h')) {
|
|
35
|
+
stdout.write(`${renderHelp()}\n`);
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
const [commandName, ...rest] = argv;
|
|
39
|
+
const command = COMMANDS[commandName];
|
|
40
|
+
if (!command) {
|
|
41
|
+
stderr.write(`Unknown command: ${commandName}\n`);
|
|
42
|
+
stderr.write(`${renderHelp()}\n`);
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
return await command(rest, { cwd, stdout, stderr });
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
const message = toErrorMessage(error);
|
|
50
|
+
stderr.write(`${message}\n`);
|
|
51
|
+
return error instanceof ProdifyError ? error.exitCode : 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { resolveRepoRoot } from '../core/repo-root.js';
|
|
2
|
+
import { runDoctor } from '../core/doctor.js';
|
|
3
|
+
export async function runDoctorCommand(args, context) {
|
|
4
|
+
void args;
|
|
5
|
+
const repoRoot = await resolveRepoRoot({
|
|
6
|
+
cwd: context.cwd,
|
|
7
|
+
allowBootstrap: true
|
|
8
|
+
});
|
|
9
|
+
const result = await runDoctor(repoRoot);
|
|
10
|
+
context.stdout.write('Prodify Doctor\n');
|
|
11
|
+
for (const check of result.checks) {
|
|
12
|
+
const status = check.skipped ? 'SKIP' : check.ok ? 'PASS' : 'FAIL';
|
|
13
|
+
context.stdout.write(`${check.label}: ${status}${check.details ? ` - ${check.details}` : ''}\n`);
|
|
14
|
+
}
|
|
15
|
+
return result.ok ? 0 : 1;
|
|
16
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { writeFileEnsuringDir } from '../core/fs.js';
|
|
2
|
+
import { resolveRepoRoot } from '../core/repo-root.js';
|
|
3
|
+
import { resolveRepoPath } from '../core/paths.js';
|
|
4
|
+
import { pathExists } from '../core/fs.js';
|
|
5
|
+
import { ProdifyError } from '../core/errors.js';
|
|
6
|
+
import { loadDefaultPreset } from '../presets/loader.js';
|
|
7
|
+
import { synchronizeRuntimeContracts } from '../contracts/compiler.js';
|
|
8
|
+
export async function runInitCommand(args, context) {
|
|
9
|
+
void args;
|
|
10
|
+
const repoRoot = await resolveRepoRoot({
|
|
11
|
+
cwd: context.cwd,
|
|
12
|
+
allowBootstrap: true
|
|
13
|
+
});
|
|
14
|
+
const prodifyDir = resolveRepoPath(repoRoot, '.prodify');
|
|
15
|
+
if (await pathExists(prodifyDir)) {
|
|
16
|
+
throw new ProdifyError('.prodify/ already exists. init stops rather than merging existing canonical files.', {
|
|
17
|
+
code: 'PRODIFY_ALREADY_EXISTS'
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
const preset = await loadDefaultPreset();
|
|
21
|
+
for (const entry of preset.entries) {
|
|
22
|
+
await writeFileEnsuringDir(resolveRepoPath(repoRoot, entry.relativePath), entry.content);
|
|
23
|
+
}
|
|
24
|
+
await synchronizeRuntimeContracts(repoRoot);
|
|
25
|
+
context.stdout.write(`Initialized Prodify in ${repoRoot}\n`);
|
|
26
|
+
context.stdout.write('Global agent setup is separate: run `prodify setup-agent <agent>` once per machine before using `$prodify-*` commands inside that agent\n');
|
|
27
|
+
context.stdout.write('Manual bootstrap starts by telling your agent to read .prodify/AGENTS.md\n');
|
|
28
|
+
context.stdout.write('Compiled runtime contracts were generated under .prodify/contracts/\n');
|
|
29
|
+
return 0;
|
|
30
|
+
}
|