@planu/cli 5.7.21 → 5.7.23
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/CHANGELOG.md +52 -0
- package/dist/.planu-build.json +1 -1
- package/dist/cli/commands/release.js +23 -10
- package/dist/cli/commands/spec.js +2 -32
- package/dist/config/registries/error-recovery.json +18 -18
- package/dist/config/registries/legacy-guidance.json +33 -1
- package/dist/config/server-instructions.js +16 -20
- package/dist/config/skill-templates/planu-release.md +3 -3
- package/dist/config/token-waste-autopilot.json +1 -1
- package/dist/core/shared/object.d.ts +3 -0
- package/dist/core/shared/object.js +12 -0
- package/dist/engine/config-loader.js +24 -32
- package/dist/engine/conventions-ttl.d.ts +2 -0
- package/dist/engine/conventions-ttl.js +1 -1
- package/dist/engine/detectors/library-detector-langs3b.d.ts +0 -5
- package/dist/engine/detectors/library-detector-langs3b.js +2 -16
- package/dist/engine/detectors/library-detector-langs5.d.ts +0 -1
- package/dist/engine/detectors/library-detector-langs5.js +2 -16
- package/dist/engine/detectors/otel-detector.js +4 -3
- package/dist/engine/detectors/otel-ecosystem-detectors.d.ts +0 -4
- package/dist/engine/detectors/otel-ecosystem-detectors.js +2 -14
- package/dist/engine/detectors/toml-dependencies.d.ts +2 -0
- package/dist/engine/detectors/toml-dependencies.js +16 -0
- package/dist/engine/drift-detection/release-status-drift.js +2 -17
- package/dist/engine/errors/registry-loader.js +3 -2
- package/dist/engine/evidence-gates/artifact-reader.d.ts +78 -0
- package/dist/engine/evidence-gates/artifact-reader.js +19 -7
- package/dist/engine/health/auto-fixer.js +2 -2
- package/dist/engine/minimality/policy-loader.js +1 -11
- package/dist/engine/model-tier-resolver.js +3 -11
- package/dist/engine/platform-detector/desktop.js +3 -13
- package/dist/engine/platform-detector/games.js +3 -13
- package/dist/engine/release-pipeline/release-spec-closer.d.ts +1 -0
- package/dist/engine/release-pipeline/release-spec-closer.js +1 -1
- package/dist/engine/safety/cross-process-lock.js +6 -21
- package/dist/engine/safety/lock-scavenger.d.ts +3 -1
- package/dist/engine/safety/lock-scavenger.js +3 -3
- package/dist/engine/score-to-grade.d.ts +2 -0
- package/dist/engine/score-to-grade.js +16 -0
- package/dist/engine/spec-grounding/contract.js +2 -1
- package/dist/engine/spec-grounding/grounding-entry-parser.d.ts +0 -1
- package/dist/engine/spec-grounding/grounding-entry-parser.js +1 -3
- package/dist/engine/telemetry/health-checker.js +2 -20
- package/dist/engine/telemetry/telemetry-client.d.ts +1 -0
- package/dist/engine/telemetry/telemetry-client.js +1 -1
- package/dist/engine/test-scaffold-generator/advanced-scaffold.js +1 -24
- package/dist/engine/token-optimizer/analytics.d.ts +1 -1
- package/dist/engine/token-optimizer/analytics.js +2 -22
- package/dist/engine/token-optimizer/policy-loader.js +1 -11
- package/dist/engine/validation-evidence-ledger.d.ts +1 -0
- package/dist/engine/validation-evidence-ledger.js +44 -3
- package/dist/engine/workers/handlers/code-map.js +4 -46
- package/dist/engine/workers/handlers/collect-files.d.ts +3 -0
- package/dist/engine/workers/handlers/collect-files.js +53 -0
- package/dist/engine/workers/handlers/documentation.js +4 -49
- package/dist/engine/workers/handlers/optimization.js +4 -46
- package/dist/engine/workers/handlers/security-audit.js +4 -45
- package/dist/hosts/codex/config-scaffold.js +1 -1
- package/dist/hosts/gemini/config-scaffold.js +1 -1
- package/dist/storage/spec-index.js +8 -3
- package/dist/storage/token-ledger-store.d.ts +1 -1
- package/dist/storage/token-ledger-store.js +2 -22
- package/dist/tools/audit.js +1 -15
- package/dist/tools/claude-settings-file.d.ts +3 -0
- package/dist/tools/claude-settings-file.js +19 -0
- package/dist/tools/create-spec/post-creation.d.ts +1 -1
- package/dist/tools/create-spec/post-creation.js +7 -49
- package/dist/tools/create-spec.js +1 -1
- package/dist/tools/facilitate.js +6 -6
- package/dist/tools/init-project/result-builder.js +4 -4
- package/dist/tools/reconcile-interactive-question-hooks.js +3 -18
- package/dist/tools/reconcile-session-safeguard-hook.js +3 -18
- package/dist/tools/reconcile-spec-sanctity-hook.js +4 -19
- package/dist/tools/safe-handler.js +1 -1
- package/dist/tools/status-handler.js +1 -1
- package/dist/tools/tool-registry/core-tools.js +3 -1
- package/dist/tools/update-status/evidence-payload.d.ts +180 -0
- package/dist/tools/update-status/evidence-payload.js +76 -0
- package/dist/tools/update-status/index.js +30 -0
- package/dist/tools/validate.js +2 -16
- package/dist/types/evidence-gates.d.ts +9 -0
- package/dist/types/lifecycle.d.ts +1 -10
- package/dist/types/spec/inputs.d.ts +2 -1
- package/dist/types/token-ledger.d.ts +1 -0
- package/dist/types/token-ledger.js +21 -1
- package/package.json +1 -1
- package/planu-plugin.json +14 -4
- package/src/i18n/messages/en.json +2 -2
- package/src/i18n/messages/es.json +2 -2
- package/src/i18n/messages/pt.json +2 -2
- package/dist/engine/detectors/cicd-detector.d.ts +0 -7
- package/dist/engine/detectors/cicd-detector.js +0 -170
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ContractValidationSchema, DiscoverySchema, TaskPlanSchema, TraceabilityMatrixSchema, handoffEvidencePath, } from '../../engine/evidence-gates/artifact-reader.js';
|
|
3
|
+
import { appendArtifact } from '../../engine/handoff-artifacts/io.js';
|
|
4
|
+
import { ImplementationReviewV1Schema, ReviewFeedbackV1Schema, } from '../../engine/handoff-artifacts/schemas.js';
|
|
5
|
+
import { atomicWriteFile } from '../../engine/safety/atomic-write-file.js';
|
|
6
|
+
export const UpdateStatusEvidencePayloadSchema = z.object({
|
|
7
|
+
discovery: DiscoverySchema.optional().describe('discovery.json: rules, examples, openQuestions, outOfScope, glossary.'),
|
|
8
|
+
taskPlan: TaskPlanSchema.optional().describe('task-plan.json: tasks mapped to acceptance criteria.'),
|
|
9
|
+
traceabilityMatrix: TraceabilityMatrixSchema.optional().describe('traceability-matrix.json: one row per acceptance criterion.'),
|
|
10
|
+
contractValidation: ContractValidationSchema.optional().describe('contract-validation-<kind>.json; kind is one of api, graphql, event, ui, mcp.'),
|
|
11
|
+
reviewFeedback: ReviewFeedbackV1Schema.optional().describe('review_feedback.md written by planu-spec-reviewer.'),
|
|
12
|
+
implementationReview: ImplementationReviewV1Schema.optional().describe('implementation_review.json written by planu-implementation-reviewer.'),
|
|
13
|
+
});
|
|
14
|
+
function transportArtifact(description) {
|
|
15
|
+
return z.record(z.string(), z.unknown()).optional().describe(description);
|
|
16
|
+
}
|
|
17
|
+
export const UpdateStatusEvidenceTransportSchema = z.object({
|
|
18
|
+
discovery: transportArtifact('Keys: version (1), rules, examples, openQuestions, outOfScope, glossary.'),
|
|
19
|
+
taskPlan: transportArtifact('Keys: version (1), tasks[{id, title, acceptanceCriteria, status}].'),
|
|
20
|
+
traceabilityMatrix: transportArtifact('Keys: version (1), rows[{acceptanceCriterion, changedFiles}].'),
|
|
21
|
+
contractValidation: transportArtifact('Keys: version (1), kind (api|graphql|event|ui|mcp), passed.'),
|
|
22
|
+
reviewFeedback: transportArtifact('Keys: schema_version, specId, verdict, reviewer, blockers, suggestions, body, reviewedAt.'),
|
|
23
|
+
implementationReview: transportArtifact('Keys: schema_version, specId, verdict, reviewer, blockers, suggestions, body, reviewedAt.'),
|
|
24
|
+
});
|
|
25
|
+
export async function persistEvidencePayload(args) {
|
|
26
|
+
const parsed = UpdateStatusEvidencePayloadSchema.safeParse(args.evidence);
|
|
27
|
+
if (!parsed.success) {
|
|
28
|
+
return {
|
|
29
|
+
ok: false,
|
|
30
|
+
errors: parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const { projectId, specId } = args;
|
|
34
|
+
const evidence = parsed.data;
|
|
35
|
+
const written = [];
|
|
36
|
+
if (evidence.discovery !== undefined) {
|
|
37
|
+
const path = handoffEvidencePath(projectId, specId, 'discovery.json');
|
|
38
|
+
await atomicWriteFile(path, `${JSON.stringify(evidence.discovery, null, 2)}\n`);
|
|
39
|
+
written.push(path);
|
|
40
|
+
}
|
|
41
|
+
if (evidence.taskPlan !== undefined) {
|
|
42
|
+
const path = handoffEvidencePath(projectId, specId, 'task-plan.json');
|
|
43
|
+
await atomicWriteFile(path, `${JSON.stringify(evidence.taskPlan, null, 2)}\n`);
|
|
44
|
+
written.push(path);
|
|
45
|
+
}
|
|
46
|
+
if (evidence.traceabilityMatrix !== undefined) {
|
|
47
|
+
const path = handoffEvidencePath(projectId, specId, 'traceability-matrix.json');
|
|
48
|
+
await atomicWriteFile(path, `${JSON.stringify(evidence.traceabilityMatrix, null, 2)}\n`);
|
|
49
|
+
written.push(path);
|
|
50
|
+
}
|
|
51
|
+
if (evidence.contractValidation !== undefined) {
|
|
52
|
+
const path = handoffEvidencePath(projectId, specId, `contract-validation-${evidence.contractValidation.kind}.json`);
|
|
53
|
+
await atomicWriteFile(path, `${JSON.stringify(evidence.contractValidation, null, 2)}\n`);
|
|
54
|
+
written.push(path);
|
|
55
|
+
}
|
|
56
|
+
if (evidence.reviewFeedback !== undefined) {
|
|
57
|
+
const { path } = await appendArtifact({
|
|
58
|
+
projectId,
|
|
59
|
+
specId,
|
|
60
|
+
kind: 'review_feedback',
|
|
61
|
+
payload: evidence.reviewFeedback,
|
|
62
|
+
});
|
|
63
|
+
written.push(path);
|
|
64
|
+
}
|
|
65
|
+
if (evidence.implementationReview !== undefined) {
|
|
66
|
+
const { path } = await appendArtifact({
|
|
67
|
+
projectId,
|
|
68
|
+
specId,
|
|
69
|
+
kind: 'implementation_review',
|
|
70
|
+
payload: evidence.implementationReview,
|
|
71
|
+
});
|
|
72
|
+
written.push(path);
|
|
73
|
+
}
|
|
74
|
+
return { ok: true, written };
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=evidence-payload.js.map
|
|
@@ -44,6 +44,7 @@ import { assertExecutionCanCommit } from '../../engine/execution/context.js';
|
|
|
44
44
|
import { shouldSkipGateForExplicitLegacyHarness } from './gate-harness.js';
|
|
45
45
|
import { assertValidationFreshnessBarrier, closeValidationFreshnessLease, } from '../../engine/validation/validation-freshness.js';
|
|
46
46
|
import { currentReconciliationInvocationContext, reconcileImplementingSpec, } from '../../engine/lifecycle-reconciliation.js';
|
|
47
|
+
import { persistEvidencePayload } from './evidence-payload.js';
|
|
47
48
|
const IMPLEMENTATION_REVIEW_DIGEST = /^sha256:[a-f0-9]{64}$/u;
|
|
48
49
|
function lifecycleAuthorityError(code, message, fixHint) {
|
|
49
50
|
return {
|
|
@@ -801,6 +802,17 @@ export async function handleUpdateStatus(params, server) {
|
|
|
801
802
|
? effectiveProjectPath
|
|
802
803
|
: (knowledge?.projectPath ?? effectiveProjectPath)) || undefined;
|
|
803
804
|
if (authorityRoute.route === 'reconcile') {
|
|
805
|
+
if (params.evidence !== undefined) {
|
|
806
|
+
return {
|
|
807
|
+
content: [
|
|
808
|
+
{
|
|
809
|
+
type: 'text',
|
|
810
|
+
text: 'Evidence payload is not accepted on the reconcile route: write the artifacts with update_status before reconciling.',
|
|
811
|
+
},
|
|
812
|
+
],
|
|
813
|
+
isError: true,
|
|
814
|
+
};
|
|
815
|
+
}
|
|
804
816
|
return reconcileImplementingSpec({
|
|
805
817
|
input: params,
|
|
806
818
|
projectId,
|
|
@@ -820,6 +832,24 @@ export async function handleUpdateStatus(params, server) {
|
|
|
820
832
|
if (lockError) {
|
|
821
833
|
return lockError;
|
|
822
834
|
}
|
|
835
|
+
if (params.evidence !== undefined && params.dry_run !== true) {
|
|
836
|
+
const persisted = await persistEvidencePayload({
|
|
837
|
+
projectId,
|
|
838
|
+
specId,
|
|
839
|
+
evidence: params.evidence,
|
|
840
|
+
});
|
|
841
|
+
if (!persisted.ok) {
|
|
842
|
+
return {
|
|
843
|
+
content: [
|
|
844
|
+
{
|
|
845
|
+
type: 'text',
|
|
846
|
+
text: `Evidence payload rejected:\n${persisted.errors.map((error) => `- ${error}`).join('\n')}`,
|
|
847
|
+
},
|
|
848
|
+
],
|
|
849
|
+
isError: true,
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
}
|
|
823
853
|
// Dry-run checks availability without acquiring. Real mutations acquire only
|
|
824
854
|
// around the compare-and-swap plus spec/store commit below.
|
|
825
855
|
const isDryRun = params.dry_run === true;
|
package/dist/tools/validate.js
CHANGED
|
@@ -62,6 +62,7 @@ import { scanCodeForSpec } from '../engine/validator/analyzer.js';
|
|
|
62
62
|
import { isBlockingQualitySeverity } from '../engine/validator/dor-dod.js';
|
|
63
63
|
import { readVerifiedImplementationReview } from '../engine/handoff-artifacts/implementation-review-reader.js';
|
|
64
64
|
import { calcQualityScore } from '../engine/auditor-scoring.js';
|
|
65
|
+
import { scoreToGrade } from '../engine/score-to-grade.js';
|
|
65
66
|
import { dispatchFeedbackEvent } from './learn.js';
|
|
66
67
|
import { t, ti } from '../i18n/index.js';
|
|
67
68
|
import { createBasicPhaseEvent } from '../engine/phase-tracker.js';
|
|
@@ -656,7 +657,7 @@ export async function executeValidate(args, server, onProgress) {
|
|
|
656
657
|
suggestions.push('Implementation incomplete. Review DoD checklist before marking as done.');
|
|
657
658
|
}
|
|
658
659
|
if (effectiveResult.missing.length > 0) {
|
|
659
|
-
suggestions.push(`${effectiveResult.missing.length} criteria still missing. Run
|
|
660
|
+
suggestions.push(`${effectiveResult.missing.length} criteria still missing. Run reconcile_spec to record the gaps.`);
|
|
660
661
|
}
|
|
661
662
|
if (graphCoverage.gaps.length > 0) {
|
|
662
663
|
suggestions.push(`${graphCoverage.gaps.length} graph-backed coverage gap(s) found without broad repository scan.`);
|
|
@@ -1085,19 +1086,4 @@ function buildCompactValidateText(args) {
|
|
|
1085
1086
|
const summaryLine = `❌ Validate: ${String(score)}/100 — failing; ${String(failedCount)} failing criteria: [${failNames}${remainingCount + shownFailures.length > 3 ? '...' : ''}]${gateSuffix}`;
|
|
1086
1087
|
return summaryLine + '\n' + failureList + moreLine + commitReminder + planuReminder;
|
|
1087
1088
|
}
|
|
1088
|
-
function scoreToGrade(score) {
|
|
1089
|
-
if (score >= 90) {
|
|
1090
|
-
return 'A';
|
|
1091
|
-
}
|
|
1092
|
-
if (score >= 80) {
|
|
1093
|
-
return 'B';
|
|
1094
|
-
}
|
|
1095
|
-
if (score >= 70) {
|
|
1096
|
-
return 'C';
|
|
1097
|
-
}
|
|
1098
|
-
if (score >= 60) {
|
|
1099
|
-
return 'D';
|
|
1100
|
-
}
|
|
1101
|
-
return 'F';
|
|
1102
|
-
}
|
|
1103
1089
|
//# sourceMappingURL=validate.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ValidationArtifactDigests, ValidationArtifactProvenance, ValidationReceipt } from './validation-receipt.js';
|
|
2
2
|
import type { ValidationGateCapability } from './validation-evidence.js';
|
|
3
|
+
import type { ArtifactPayload } from './handoff-artifacts.js';
|
|
3
4
|
export type EvidenceGateTransition = 'approved' | 'implementing' | 'done';
|
|
4
5
|
export interface DiscoveryEvidence {
|
|
5
6
|
version: 1;
|
|
@@ -61,6 +62,14 @@ export interface ContractValidationEvidence {
|
|
|
61
62
|
reportPath?: string;
|
|
62
63
|
summary?: string;
|
|
63
64
|
}
|
|
65
|
+
export interface UpdateStatusEvidencePayload {
|
|
66
|
+
discovery?: DiscoveryEvidence;
|
|
67
|
+
taskPlan?: TaskPlanEvidence;
|
|
68
|
+
traceabilityMatrix?: TraceabilityMatrixEvidence;
|
|
69
|
+
contractValidation?: ContractValidationEvidence;
|
|
70
|
+
reviewFeedback?: ArtifactPayload<'review_feedback'>;
|
|
71
|
+
implementationReview?: ArtifactPayload<'implementation_review'>;
|
|
72
|
+
}
|
|
64
73
|
export interface EvidenceArtifacts {
|
|
65
74
|
discovery?: DiscoveryEvidence;
|
|
66
75
|
taskPlan?: TaskPlanEvidence;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export interface CiCdDetection {
|
|
3
|
-
platform: CiCdPlatform | null;
|
|
4
|
-
configFile: string | null;
|
|
5
|
-
multipleDetected: CiCdPlatform[];
|
|
6
|
-
hasDeployStage: boolean;
|
|
7
|
-
hasDependencyAudit: boolean;
|
|
8
|
-
hasTestStage: boolean;
|
|
9
|
-
hasLintStage: boolean;
|
|
10
|
-
}
|
|
1
|
+
export {};
|
|
11
2
|
/** SPEC-747: Input for retro-audit of frozen specs */
|
|
12
3
|
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -3,6 +3,7 @@ import type { Actuals } from '../estimation.js';
|
|
|
3
3
|
import type { GlobalConfig } from '../project/config-metrics.js';
|
|
4
4
|
import type { StructuredErrorNextAction } from '../errors/structured-error.js';
|
|
5
5
|
import type { Spec, SpecDiagram, SpecSplitSuggestion, ReconcileChange } from './core.js';
|
|
6
|
+
import type { UpdateStatusEvidencePayload } from '../evidence-gates.js';
|
|
6
7
|
export interface ReconciliationInvocationContext {
|
|
7
8
|
surface: 'local-mcp' | 'http' | 'dashboard' | 'direct' | 'unknown';
|
|
8
9
|
}
|
|
@@ -100,6 +101,7 @@ export interface UpdateStatusInput {
|
|
|
100
101
|
expectedImplementingTransitionId?: string;
|
|
101
102
|
/** sha256: digest of validation-report.json; derived for done when omitted. */
|
|
102
103
|
implementationReviewDigest?: string;
|
|
104
|
+
evidence?: UpdateStatusEvidencePayload;
|
|
103
105
|
/**
|
|
104
106
|
* SPEC-769: Force-approve a spec that scored below 70 on the readiness gate.
|
|
105
107
|
* When true, the transition proceeds and qualityWarnings[] is written to spec.md frontmatter.
|
|
@@ -181,7 +183,6 @@ export interface ChallengeSpecInput {
|
|
|
181
183
|
export interface PostCreationSuggestion {
|
|
182
184
|
tool: string;
|
|
183
185
|
reason: string;
|
|
184
|
-
templateCategory?: string;
|
|
185
186
|
}
|
|
186
187
|
export interface CreateSpecResult {
|
|
187
188
|
specId: string;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
// Token Ledger Types (SPEC-182)
|
|
2
|
-
export {
|
|
2
|
+
export function emptyLedgerAggregation() {
|
|
3
|
+
return {
|
|
4
|
+
totalTokens: 0,
|
|
5
|
+
totalInputTokens: 0,
|
|
6
|
+
totalOutputTokens: 0,
|
|
7
|
+
totalCostUsd: 0,
|
|
8
|
+
totalEstimatedCostUsd: 0,
|
|
9
|
+
entryCount: 0,
|
|
10
|
+
uniqueTools: 0,
|
|
11
|
+
uniqueModels: 0,
|
|
12
|
+
uniqueSessions: 0,
|
|
13
|
+
avgTokensPerCall: 0,
|
|
14
|
+
avgCostPerCall: 0,
|
|
15
|
+
tokensByTool: {},
|
|
16
|
+
costByTool: {},
|
|
17
|
+
tokensByModel: {},
|
|
18
|
+
costByModel: {},
|
|
19
|
+
estimationAccuracy: 100,
|
|
20
|
+
overEstimationPercent: 0,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
3
23
|
// ---------------------------------------------------------------------------
|
|
4
24
|
// Token intelligence handler types (SPEC-182)
|
|
5
25
|
// ---------------------------------------------------------------------------
|
package/package.json
CHANGED
package/planu-plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dev.planu.cli",
|
|
3
3
|
"displayName": "Planu — Spec Driven Development",
|
|
4
4
|
"description": "Manage software specs, estimations, and autonomous SDD workflows. Language-agnostic MCP server for Claude Code.",
|
|
5
|
-
"version": "5.7.
|
|
5
|
+
"version": "5.7.23",
|
|
6
6
|
"icon": "assets/plugin/icon.svg",
|
|
7
7
|
"command": ["npx", "@planu/cli@latest"],
|
|
8
8
|
"packageName": "@planu/cli",
|
|
@@ -28,9 +28,19 @@
|
|
|
28
28
|
"get_job",
|
|
29
29
|
"restart_job"
|
|
30
30
|
],
|
|
31
|
-
"resources": [
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
"resources": [
|
|
32
|
+
"planu://budget/status",
|
|
33
|
+
"planu://patterns",
|
|
34
|
+
"planu://process",
|
|
35
|
+
"planu://specs",
|
|
36
|
+
"planu://templates",
|
|
37
|
+
"planu://usage/stats",
|
|
38
|
+
"planu://velocity/report",
|
|
39
|
+
"planu://workspace/health",
|
|
40
|
+
"planu://workspace/overview"
|
|
41
|
+
],
|
|
42
|
+
"prompts": ["create-feature", "implement-spec", "project-status", "review-spec"],
|
|
43
|
+
"subagents": ["planu-challenger", "planu-readiness-auditor", "planu-spec-implementer", "planu-validator"]
|
|
34
44
|
},
|
|
35
45
|
"compatibility": { "minimumHostVersion": "1.0.0", "requiredFeatures": ["mcp-tools", "file-editing"] },
|
|
36
46
|
"repository": "https://github.com/planu-dev/planu",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"notImplemented": "init_project is not yet implemented"
|
|
71
71
|
},
|
|
72
72
|
"create_spec": {
|
|
73
|
-
"description": "Create a full SDD spec from a description. Call this directly
|
|
73
|
+
"description": "Create a full SDD spec from a description. Call this directly. CRITICAL — INTERACTIVE QUESTIONS: If the response contains needsClarification: true and a questions[] array, you MUST present those questions using your native interactive UI (AskUserQuestion in Claude Code or equivalent submit component). DO NOT display the JSON as text. Each question has: question, header, options[] (with label + description), multiSelect. After the user answers, call create_spec AGAIN with an enriched description. IMPORTANT — UX behavior: When the user describes something broad (e.g. 'build me a billing system', 'I want an e-commerce app'), DO NOT create a single spec. Instead: 1) Break it down into multiple specs (authentication, products, cart, payments, etc.). 2) Present the plan BEFORE creating anything: 'Based on what you told me, I am going to create X specs to cover everything you need: [list each spec with a one-line summary]. Each spec is a detailed plan with acceptance criteria — think of it as a checklist of what done looks like. Shall I go ahead?' 3) Wait for confirmation, then call create_spec once per feature. 4) After creating all specs, summarize: what was created, estimated total effort, and suggested order of implementation. 5) ALWAYS suggest creating a git branch for implementation: 'Now I recommend creating a branch to work on this safely: git checkout -b feat/SPEC-XXX-feature-name. This keeps your main code protected while you build.' For small/single features, explain briefly what the spec will contain and create it directly. Always be friendly and use plain language. If the response contains autopilotSummary[], mention those actions to the user in your reply so they know what Planu did automatically.",
|
|
74
74
|
"success": "Spec {id} created: {title}",
|
|
75
75
|
"notImplemented": "create_spec is not yet implemented"
|
|
76
76
|
},
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"notImplemented": "list_specs is not yet implemented"
|
|
81
81
|
},
|
|
82
82
|
"update_status": {
|
|
83
|
-
"description": "Move a plan forward in its lifecycle. Plans go through these stages: draft (work in progress) → review (ready for someone to check) → approved (ready to build) → implementing (being built) → done (finished and verified). IMPORTANT: When moving to 'implementing', ALWAYS suggest creating a dedicated git branch: 'Before you start building, let me create a branch for this spec so your changes are isolated: git checkout -b feat/SPEC-XXX-name.' When moving to 'done', suggest merging: 'This feature is complete! You can now merge your branch back and create a pull request.'
|
|
83
|
+
"description": "Move a plan forward in its lifecycle. Plans go through these stages: draft (work in progress) → review (ready for someone to check) → approved (ready to build) → implementing (being built) → done (finished and verified). IMPORTANT: When moving to 'implementing', ALWAYS suggest creating a dedicated git branch: 'Before you start building, let me create a branch for this spec so your changes are isolated: git checkout -b feat/SPEC-XXX-name.' When moving to 'done', suggest merging: 'This feature is complete! You can now merge your branch back and create a pull request.' If the response contains autopilotSummary[], mention those actions to the user in your reply so they know what Planu did automatically. If the response contains interactiveQuestions[], present them to the user using AskUserQuestion (Claude Code) or equivalent interactive UI. DO NOT display the JSON as text.",
|
|
84
84
|
"success": "Spec {specId} status updated to {status}",
|
|
85
85
|
"notImplemented": "update_status is not yet implemented"
|
|
86
86
|
},
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"notImplemented": "init_project aún no está implementado"
|
|
71
71
|
},
|
|
72
72
|
"create_spec": {
|
|
73
|
-
"description": "Crear una spec SDD completa desde una descripción. Llamar directamente
|
|
73
|
+
"description": "Crear una spec SDD completa desde una descripción. Llamar directamente. IMPORTANTE — Comportamiento UX: Cuando el usuario describe algo amplio (ej: 'hazme un sistema de facturación', 'quiero una app de e-commerce'), NO crees una sola spec. En su lugar: 1) Descompón en múltiples specs (autenticación, productos, carrito, pagos, etc.). 2) Presenta el plan ANTES de crear nada: 'Basándome en lo que me contaste, voy a crear X specs para cubrir todo lo que necesitas: [lista cada spec con un resumen de una línea]. Cada spec es un plan detallado con criterios de aceptación — piénsalo como una checklist de qué significa que esté terminado. ¿Le damos?' 3) Espera confirmación, luego llama create_spec una vez por feature. 4) Después de crear todas, resume: qué se creó, esfuerzo total estimado y orden sugerido de implementación. 5) SIEMPRE sugiere crear una rama git para implementar: 'Ahora te recomiendo crear una rama para trabajar de forma segura: git checkout -b feat/SPEC-XXX-nombre-feature. Así tu código principal queda protegido mientras construyes.' Para features pequeñas/individuales, explica brevemente qué contendrá la spec y créala directamente. Siempre sé amigable y usa lenguaje simple. Si la respuesta contiene autopilotSummary[], menciona esas acciones al usuario para que sepa qué hizo Planu automáticamente.",
|
|
74
74
|
"success": "Spec {id} creada: {title}",
|
|
75
75
|
"notImplemented": "create_spec aún no está implementado"
|
|
76
76
|
},
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"notImplemented": "list_specs aún no está implementado"
|
|
81
81
|
},
|
|
82
82
|
"update_status": {
|
|
83
|
-
"description": "Mover un plan hacia adelante en su ciclo de vida. Los planes pasan por estas etapas: borrador (trabajo en progreso) → revisión (listo para que alguien lo revise) → aprobado (listo para construir) → implementando (se está construyendo) → terminado (completado y verificado). IMPORTANTE: Al mover a 'implementando', SIEMPRE sugiere crear una rama git dedicada: 'Antes de empezar a construir, vamos a crear una rama para esta spec así tus cambios quedan aislados: git checkout -b feat/SPEC-XXX-nombre.' Al mover a 'terminado', sugiere mergear: '¡Esta feature está completa! Ahora puedes mergear tu rama y crear un pull request.'
|
|
83
|
+
"description": "Mover un plan hacia adelante en su ciclo de vida. Los planes pasan por estas etapas: borrador (trabajo en progreso) → revisión (listo para que alguien lo revise) → aprobado (listo para construir) → implementando (se está construyendo) → terminado (completado y verificado). IMPORTANTE: Al mover a 'implementando', SIEMPRE sugiere crear una rama git dedicada: 'Antes de empezar a construir, vamos a crear una rama para esta spec así tus cambios quedan aislados: git checkout -b feat/SPEC-XXX-nombre.' Al mover a 'terminado', sugiere mergear: '¡Esta feature está completa! Ahora puedes mergear tu rama y crear un pull request.' Si la respuesta contiene autopilotSummary[], menciona esas acciones al usuario para que sepa qué hizo Planu automáticamente. Si la respuesta contiene interactiveQuestions[], preséntalas al usuario usando AskUserQuestion (Claude Code) o interfaz interactiva equivalente. NO muestres el JSON como texto.",
|
|
84
84
|
"success": "Spec {specId} actualizada a estado {status}",
|
|
85
85
|
"notImplemented": "update_status aún no está implementado"
|
|
86
86
|
},
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"notImplemented": "init_project ainda não está implementado"
|
|
71
71
|
},
|
|
72
72
|
"create_spec": {
|
|
73
|
-
"description": "Criar uma spec SDD completa a partir de uma descrição. Chamar diretamente
|
|
73
|
+
"description": "Criar uma spec SDD completa a partir de uma descrição. Chamar diretamente. IMPORTANTE — Comportamento UX: Quando o usuário descreve algo amplo (ex: 'me faz um sistema de faturamento', 'quero um app de e-commerce'), NÃO crie uma única spec. Em vez disso: 1) Decomponha em múltiplas specs (autenticação, produtos, carrinho, pagamentos, etc.). 2) Apresente o plano ANTES de criar: 'Com base no que você me contou, vou criar X specs para cobrir tudo que precisa: [lista cada spec com resumo de uma linha]. Cada spec é um plano detalhado com critérios de aceitação — pense como uma checklist do que significa estar pronto. Posso ir em frente?' 3) Espere confirmação, depois chame create_spec uma vez por feature. 4) Após criar todas, resuma: o que foi criado, esforço total estimado e ordem sugerida de implementação. 5) SEMPRE sugira criar uma branch git para implementação: 'Agora recomendo criar uma branch para trabalhar com segurança: git checkout -b feat/SPEC-XXX-nome-feature. Assim seu código principal fica protegido enquanto você constrói.' Para features pequenas/individuais, explique brevemente e crie direto. Sempre seja amigável e use linguagem simples. Se a resposta contiver autopilotSummary[], mencione essas ações ao usuário para que ele saiba o que o Planu fez automaticamente.",
|
|
74
74
|
"success": "Spec {id} criada: {title}",
|
|
75
75
|
"notImplemented": "create_spec ainda não está implementado"
|
|
76
76
|
},
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"notImplemented": "list_specs ainda não está implementado"
|
|
81
81
|
},
|
|
82
82
|
"update_status": {
|
|
83
|
-
"description": "Mover um plano adiante no seu ciclo de vida. Os planos passam por estas etapas: rascunho (trabalho em progresso) → revisão (pronto para alguém verificar) → aprovado (pronto para construir) → implementando (sendo construído) → concluído (terminado e verificado). IMPORTANTE: Ao mover para 'implementando', SEMPRE sugira criar uma branch git dedicada: 'Antes de começar a construir, vamos criar uma branch para esta spec assim suas mudanças ficam isoladas: git checkout -b feat/SPEC-XXX-nome.' Ao mover para 'concluído', sugira fazer merge: 'Esta feature está completa! Agora você pode fazer merge da sua branch e criar um pull request.'
|
|
83
|
+
"description": "Mover um plano adiante no seu ciclo de vida. Os planos passam por estas etapas: rascunho (trabalho em progresso) → revisão (pronto para alguém verificar) → aprovado (pronto para construir) → implementando (sendo construído) → concluído (terminado e verificado). IMPORTANTE: Ao mover para 'implementando', SEMPRE sugira criar uma branch git dedicada: 'Antes de começar a construir, vamos criar uma branch para esta spec assim suas mudanças ficam isoladas: git checkout -b feat/SPEC-XXX-nome.' Ao mover para 'concluído', sugira fazer merge: 'Esta feature está completa! Agora você pode fazer merge da sua branch e criar um pull request.' Se a resposta contiver autopilotSummary[], mencione essas ações ao usuário para que ele saiba o que o Planu fez automaticamente. Se a resposta contiver interactiveQuestions[], apresente-as ao usuário usando AskUserQuestion (Claude Code) ou interface interativa equivalente. NÃO exiba o JSON como texto.",
|
|
84
84
|
"success": "Spec {specId} atualizada para status {status}",
|
|
85
85
|
"notImplemented": "update_status ainda não está implementado"
|
|
86
86
|
},
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CiCdDetection } from '../../types/index.js';
|
|
2
|
-
/**
|
|
3
|
-
* Detects CI/CD platforms present in the project.
|
|
4
|
-
* Uses hierarchical ordering — first match wins for primary platform.
|
|
5
|
-
*/
|
|
6
|
-
export declare function detectCiCd(projectPath: string): Promise<CiCdDetection>;
|
|
7
|
-
//# sourceMappingURL=cicd-detector.d.ts.map
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { technologyValue } from '../technology-registry.js';
|
|
2
|
-
import { fileExistsByRead } from '../../core/shared/fs.js';
|
|
3
|
-
// engine/detectors/cicd-detector.ts — CI/CD platform detection (SPEC-026a)
|
|
4
|
-
// Hierarchical detection: GitHub Actions > GitLab CI > CircleCI > Buildkite >
|
|
5
|
-
// Azure DevOps > Jenkins > Drone > Woodpecker > Tekton > rest
|
|
6
|
-
import { readFile } from 'node:fs/promises';
|
|
7
|
-
import { join } from 'node:path';
|
|
8
|
-
import { glob } from 'glob';
|
|
9
|
-
// === Detection rules (ordered by priority) ===
|
|
10
|
-
// Each entry specifies the platform, static file paths, and optional glob patterns.
|
|
11
|
-
const CICD_SIGNALS = [
|
|
12
|
-
{
|
|
13
|
-
platform: 'github-actions',
|
|
14
|
-
paths: [],
|
|
15
|
-
globPatterns: ['.github/workflows/*.yml', '.github/workflows/*.yaml'],
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
platform: 'gitlab-ci',
|
|
19
|
-
paths: ['.gitlab-ci.yml', '.gitlab-ci.yaml'],
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
platform: 'circleci',
|
|
23
|
-
paths: ['.circleci/config.yml', '.circleci/config.yaml'],
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
platform: 'buildkite',
|
|
27
|
-
paths: ['.buildkite/pipeline.yml', '.buildkite/pipeline.yaml'],
|
|
28
|
-
globPatterns: ['.buildkite/*.yml'],
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
platform: 'azure-devops',
|
|
32
|
-
paths: ['azure-pipelines.yml', 'azure-pipelines.yaml'],
|
|
33
|
-
globPatterns: ['azure-pipelines*.yml'],
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
platform: 'jenkins',
|
|
37
|
-
paths: ['Jenkinsfile'],
|
|
38
|
-
globPatterns: ['Jenkinsfile*'],
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
platform: 'drone',
|
|
42
|
-
paths: ['.drone.yml', '.drone.yaml'],
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
platform: 'woodpecker',
|
|
46
|
-
paths: ['.woodpecker.yml', '.woodpecker.yaml'],
|
|
47
|
-
globPatterns: ['.woodpecker/*.yml'],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
platform: 'tekton',
|
|
51
|
-
paths: [],
|
|
52
|
-
globPatterns: ['tekton/**/*.yaml', '.tekton/**/*.yaml'],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
platform: 'travis-ci',
|
|
56
|
-
paths: ['.travis.yml', '.travis.yaml'],
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
platform: 'bitbucket-pipelines',
|
|
60
|
-
paths: ['bitbucket-pipelines.yml'],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
platform: 'teamcity',
|
|
64
|
-
paths: ['.teamcity/settings.kts'],
|
|
65
|
-
globPatterns: ['.teamcity/**/*.kts'],
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
platform: 'concourse',
|
|
69
|
-
paths: ['ci/pipeline.yml', 'concourse/pipeline.yml'],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
platform: 'harness',
|
|
73
|
-
paths: ['.harness/pipeline.yaml'],
|
|
74
|
-
globPatterns: ['.harness/**/*.yaml'],
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
// === Public API ===
|
|
78
|
-
/**
|
|
79
|
-
* Detects CI/CD platforms present in the project.
|
|
80
|
-
* Uses hierarchical ordering — first match wins for primary platform.
|
|
81
|
-
*/
|
|
82
|
-
export async function detectCiCd(projectPath) {
|
|
83
|
-
const detected = [];
|
|
84
|
-
const foundFiles = {};
|
|
85
|
-
for (const signal of CICD_SIGNALS) {
|
|
86
|
-
const files = await findSignalFiles(projectPath, signal);
|
|
87
|
-
if (files.length > 0) {
|
|
88
|
-
detected.push(signal.platform);
|
|
89
|
-
foundFiles[signal.platform] = files;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const primary = detected[0] ?? null;
|
|
93
|
-
const multipleDetected = detected.slice(1);
|
|
94
|
-
const configFile = primary !== null ? (foundFiles[primary]?.[0] ?? null) : null;
|
|
95
|
-
// Analyze primary config for CI stage details
|
|
96
|
-
const stageInfo = primary !== null && configFile !== null
|
|
97
|
-
? await analyzeCiCdStages(projectPath, configFile)
|
|
98
|
-
: {
|
|
99
|
-
hasDeployStage: false,
|
|
100
|
-
hasDependencyAudit: false,
|
|
101
|
-
hasTestStage: false,
|
|
102
|
-
hasLintStage: false,
|
|
103
|
-
};
|
|
104
|
-
return {
|
|
105
|
-
platform: primary,
|
|
106
|
-
configFile,
|
|
107
|
-
multipleDetected,
|
|
108
|
-
...stageInfo,
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
// === Internal helpers ===
|
|
112
|
-
async function findSignalFiles(projectPath, signal) {
|
|
113
|
-
const found = [];
|
|
114
|
-
// Check explicit paths
|
|
115
|
-
for (const p of signal.paths) {
|
|
116
|
-
const exists = await fileExistsByRead(join(projectPath, p));
|
|
117
|
-
if (exists) {
|
|
118
|
-
found.push(p);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
// Check glob patterns
|
|
122
|
-
if (signal.globPatterns && signal.globPatterns.length > 0) {
|
|
123
|
-
for (const pattern of signal.globPatterns) {
|
|
124
|
-
try {
|
|
125
|
-
const matches = await glob(pattern, { cwd: projectPath, nodir: true });
|
|
126
|
-
found.push(...matches);
|
|
127
|
-
}
|
|
128
|
-
catch {
|
|
129
|
-
// ignore glob errors
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return found;
|
|
134
|
-
}
|
|
135
|
-
async function analyzeCiCdStages(projectPath, configFile) {
|
|
136
|
-
try {
|
|
137
|
-
const content = await readFile(join(projectPath, configFile), 'utf-8');
|
|
138
|
-
const lower = content.toLowerCase();
|
|
139
|
-
return {
|
|
140
|
-
hasDeployStage: lower.includes('deploy') ||
|
|
141
|
-
lower.includes('release') ||
|
|
142
|
-
lower.includes('publish') ||
|
|
143
|
-
lower.includes('ship'),
|
|
144
|
-
hasDependencyAudit: lower.includes('audit') ||
|
|
145
|
-
lower.includes('snyk') ||
|
|
146
|
-
lower.includes('trivy') ||
|
|
147
|
-
lower.includes('dependabot') ||
|
|
148
|
-
lower.includes('safety'),
|
|
149
|
-
hasTestStage: lower.includes('test') ||
|
|
150
|
-
lower.includes('spec') ||
|
|
151
|
-
lower.includes(technologyValue('technology-vitest-a9127f')) ||
|
|
152
|
-
lower.includes(technologyValue('technology-pytest-2b0121')) ||
|
|
153
|
-
lower.includes(technologyValue('technology-jest-35e99f')),
|
|
154
|
-
hasLintStage: lower.includes('lint') ||
|
|
155
|
-
lower.includes('eslint') ||
|
|
156
|
-
lower.includes('prettier') ||
|
|
157
|
-
lower.includes('ruff') ||
|
|
158
|
-
lower.includes('biome'),
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
catch {
|
|
162
|
-
return {
|
|
163
|
-
hasDeployStage: false,
|
|
164
|
-
hasDependencyAudit: false,
|
|
165
|
-
hasTestStage: false,
|
|
166
|
-
hasLintStage: false,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
//# sourceMappingURL=cicd-detector.js.map
|